mirror of https://git.ffmpeg.org/ffmpeg.git
avformat/gxf: Check pkt_len
Fixes: Infinite loop
Fixes: 26576/clusterfuzz-testcase-minimized-ffmpeg_dem_GXF_fuzzer-4823080360476672
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit dad9a86ca7
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
c1574b35c3
commit
5d804bfba3
|
@ -285,9 +285,12 @@ static void gxf_track_tags(AVIOContext *pb, int *len, struct gxf_stream_info *si
|
||||||
static void gxf_read_index(AVFormatContext *s, int pkt_len) {
|
static void gxf_read_index(AVFormatContext *s, int pkt_len) {
|
||||||
AVIOContext *pb = s->pb;
|
AVIOContext *pb = s->pb;
|
||||||
AVStream *st;
|
AVStream *st;
|
||||||
uint32_t fields_per_map = avio_rl32(pb);
|
uint32_t fields_per_map, map_cnt;
|
||||||
uint32_t map_cnt = avio_rl32(pb);
|
|
||||||
int i;
|
int i;
|
||||||
|
if (pkt_len < 8)
|
||||||
|
return;
|
||||||
|
fields_per_map = avio_rl32(pb);
|
||||||
|
map_cnt = avio_rl32(pb);
|
||||||
pkt_len -= 8;
|
pkt_len -= 8;
|
||||||
if ((s->flags & AVFMT_FLAG_IGNIDX) || !s->streams) {
|
if ((s->flags & AVFMT_FLAG_IGNIDX) || !s->streams) {
|
||||||
avio_skip(pb, pkt_len);
|
avio_skip(pb, pkt_len);
|
||||||
|
|
Loading…
Reference in New Issue