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 <mich...@niedermayer.cc>
---
 libavformat/moflex.c | 2 ++
 1 file changed, 2 insertions(+)

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);
-- 
2.17.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to