Fixes: OOM
Fixes: 
54572/clusterfuzz-testcase-minimized-ffmpeg_dem_LAF_fuzzer-4974038870523904

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>
---
 libavformat/lafdec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/lafdec.c b/libavformat/lafdec.c
index d02b479c4d..b78ec3649c 100644
--- a/libavformat/lafdec.c
+++ b/libavformat/lafdec.c
@@ -208,6 +208,8 @@ again:
         ret = avio_read(pb, s->data, st_count * st->codecpar->sample_rate * 
bpp);
         if (ret < 0)
             return ret;
+        if (ret != st_count * st->codecpar->sample_rate * bpp)
+            return AVERROR_INVALIDDATA;
     }
 
     st = ctx->streams[s->index];
-- 
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