diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-10-15 22:19:32 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-09-09 13:53:29 +0200 |
commit | 5be63051e7ba70afc8660ecb81071679695af255 (patch) | |
tree | 2bec639087e77a568d0b7aa1fdfc364f400ea1f0 | |
parent | 5aaf7f46460f6811a41623d36112abfb80b80257 (diff) | |
download | ffmpeg-5be63051e7ba70afc8660ecb81071679695af255.tar.gz |
avformat/au: Check for EOF in au_read_annotation()
Fixes: Timeout (too looong -> 1 ms)
Fixes: 26366/clusterfuzz-testcase-minimized-ffmpeg_dem_SDX_fuzzer-5655584843759616
Fixes: 26391/clusterfuzz-testcase-minimized-ffmpeg_dem_ALP_fuzzer-5484026133217280
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 e680d50eb4feddafb2d8575b21fc5fc8764f4801)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/au.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/au.c b/libavformat/au.c index 520824fc12..a414292894 100644 --- a/libavformat/au.c +++ b/libavformat/au.c @@ -86,6 +86,8 @@ static int au_read_annotation(AVFormatContext *s, int size) av_bprint_init(&bprint, 64, AV_BPRINT_SIZE_UNLIMITED); while (size-- > 0) { + if (avio_feof(pb)) + return AVERROR_EOF; c = avio_r8(pb); switch(state) { case PARSE_KEY: |