aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-05-04 18:34:44 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-10-09 22:02:21 +0200
commite992d0668d3db2996c5ad73e78dc855b91e9da3f (patch)
tree6204cb5c82f578f85b06e1cfd09159962dd76491
parentbfa18954722695fb38cc1a01f776a1ebb225d58a (diff)
downloadffmpeg-e992d0668d3db2996c5ad73e78dc855b91e9da3f.tar.gz
avformat/tta: Check for EOF in index reading loop
Fixes: OOM Fixes: 33585/clusterfuzz-testcase-minimized-ffmpeg_dem_TTA_fuzzer-4564665830080512 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit b72d657b73b2aa4a2a2f72f613199e6080ad48c0) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/tta.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/tta.c b/libavformat/tta.c
index 24f7808057..5c874d53c6 100644
--- a/libavformat/tta.c
+++ b/libavformat/tta.c
@@ -119,6 +119,8 @@ static int tta_read_header(AVFormatContext *s)
for (i = 0; i < c->totalframes; i++) {
uint32_t size = avio_rl32(s->pb);
int r;
+ if (avio_feof(s->pb))
+ return AVERROR_INVALIDDATA;
if ((r = av_add_index_entry(st, framepos, i * (int64_t)c->frame_size, size, 0,
AVINDEX_KEYFRAME)) < 0)
return r;