mirror of https://git.ffmpeg.org/ffmpeg.git
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:
parent
35871c26d2
commit
ad95d9c855
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
#include "libavutil/intreadwrite.h"
|
#include "libavutil/intreadwrite.h"
|
||||||
#include "avformat.h"
|
#include "avformat.h"
|
||||||
|
#include "avio_internal.h"
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
|
|
||||||
#define MAX_STREAMS 4096
|
#define MAX_STREAMS 4096
|
||||||
|
@ -205,7 +206,7 @@ again:
|
||||||
s->nb_stored = st_count;
|
s->nb_stored = st_count;
|
||||||
if (!st_count)
|
if (!st_count)
|
||||||
return AVERROR_INVALIDDATA;
|
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)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue