aboutsummaryrefslogtreecommitdiff
path: root/libavformat/img2dec.c
diff options
context:
space:
mode:
authorMichael Niedermayer2015-04-20 23:59:53 +0200
committerMichael Niedermayer2015-04-20 23:59:53 +0200
commite6e8cc8ce9c2a398fbb51254a5067f4bd3c4fa8a (patch)
tree76c994aa8e1d648ce9a16c9d00fb60aba93b863d /libavformat/img2dec.c
parent954b5e340e8ea930f13a9ff2f3a7cbf7ccb3d989 (diff)
avformat/img2dec: do not rewind custom io buffers
Fixes double free with some applications Fixes vlc ticket14121 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/img2dec.c')
-rw-r--r--libavformat/img2dec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
index 8c5e9d5d56..5fc5b8342d 100644
--- a/libavformat/img2dec.c
+++ b/libavformat/img2dec.c
@@ -341,7 +341,10 @@ int ff_img_read_header(AVFormatContext *s1)
break;
}
}
- ffio_rewind_with_probe_data(s1->pb, &probe_buffer, probe_buffer_size);
+ if (s1->flags & AVFMT_FLAG_CUSTOM_IO) {
+ avio_seek(s1->pb, 0, SEEK_SET);
+ } else
+ ffio_rewind_with_probe_data(s1->pb, &probe_buffer, probe_buffer_size);
}
if (st->codec->codec_id == AV_CODEC_ID_NONE)
st->codec->codec_id = ff_guess_image2_codec(s->path);