mirror of https://git.ffmpeg.org/ffmpeg.git
avformat/icodec: Change order of operations to avoid NULL dereference
Fixes: SEGV on unknown address 0x000000000000
Fixes: 26379/clusterfuzz-testcase-minimized-ffmpeg_dem_ICO_fuzzer-5709011753893888
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3300f5c133
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
55698d3ef2
commit
db799e0bc2
|
@ -156,12 +156,14 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||
IcoDemuxContext *ico = s->priv_data;
|
||||
IcoImage *image;
|
||||
AVIOContext *pb = s->pb;
|
||||
AVStream *st = s->streams[0];
|
||||
AVStream *st;
|
||||
int ret;
|
||||
|
||||
if (ico->current_image >= ico->nb_images)
|
||||
return AVERROR_EOF;
|
||||
|
||||
st = s->streams[0];
|
||||
|
||||
image = &ico->images[ico->current_image];
|
||||
|
||||
if ((ret = avio_seek(pb, image->offset, SEEK_SET)) < 0)
|
||||
|
|
Loading…
Reference in New Issue