diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-10-25 00:23:07 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-11-22 17:45:17 +0100 |
commit | 40348637bee613a9123d869acd7be0ce837653ad (patch) | |
tree | ed3b3935f24becb1cc0b3d8f5b57fbf272974e6b /libavformat/moflex.c | |
parent | 42ccef2846ed04c8c0532f5e60040e16fc8f6953 (diff) | |
download | ffmpeg-40348637bee613a9123d869acd7be0ce837653ad.tar.gz |
avformat/moflex: Check pkt_size
Fixes: Timeout (>20sec -> 1ms)
Fixes: 26527/clusterfuzz-testcase-minimized-ffmpeg_dem_MOFLEX_fuzzer-6308307310215168
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/moflex.c')
-rw-r--r-- | libavformat/moflex.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/moflex.c b/libavformat/moflex.c index a24e12eb8e..8142925adc 100644 --- a/libavformat/moflex.c +++ b/libavformat/moflex.c @@ -316,6 +316,8 @@ static int moflex_read_packet(AVFormatContext *s, AVPacket *pkt) } pkt_size = pop_int(br, pb, 13) + 1; + if (pkt_size > m->size) + return AVERROR_INVALIDDATA; packet = s->streams[stream_index]->priv_data; if (!packet) { avio_skip(pb, pkt_size); |