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@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2023-01-30 23:08:14 +01:00
parent 35871c26d2
commit ad95d9c855
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
1 changed files with 2 additions and 1 deletions

View File

@ -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;
}