[FFmpeg-cvslog] avformat/lafdec: Check if all data was read
Michael Niedermayer
git at videolan.org
Wed Feb 1 21:24:07 EET 2023
ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Mon Jan 30 23:08:14 2023 +0100| [ad95d9c855db3e78e6495ea52e5fd2e089320d74] | committer: Michael Niedermayer
avformat/lafdec: Check if all data was read
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 <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ad95d9c855db3e78e6495ea52e5fd2e089320d74
---
libavformat/lafdec.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libavformat/lafdec.c b/libavformat/lafdec.c
index d02b479c4d..a1775e1b69 100644
--- a/libavformat/lafdec.c
+++ b/libavformat/lafdec.c
@@ -21,6 +21,7 @@
#include "libavutil/intreadwrite.h"
#include "avformat.h"
+#include "avio_internal.h"
#include "internal.h"
#define MAX_STREAMS 4096
@@ -205,7 +206,7 @@ again:
s->nb_stored = st_count;
if (!st_count)
return AVERROR_INVALIDDATA;
- ret = avio_read(pb, s->data, st_count * st->codecpar->sample_rate * bpp);
+ ret = ffio_read_size(pb, s->data, st_count * st->codecpar->sample_rate * bpp);
if (ret < 0)
return ret;
}
More information about the ffmpeg-cvslog
mailing list