aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-05-18 01:48:38 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2018-06-15 22:31:13 +0200
commit217367b5eb0a6be8e1c5c819ef2a407d30591091 (patch)
tree986682f17e117e3f0485b86521b5b4209ac14bd2
parentc97f9ed53f41b2305fcdea42027979285078b9d4 (diff)
downloadffmpeg-217367b5eb0a6be8e1c5c819ef2a407d30591091.tar.gz
avcodec/ac3dec: Use frame_size if superframe_size is 0
Fixes: Infinite loop Fixes: 7669/clusterfuzz-testcase-ffmpeg_AV_CODEC_ID_AC3_FIXED_fuzzer-4689042185650176 Fixes: 7670/clusterfuzz-testcase-ffmpeg_AV_CODEC_ID_AC3_fuzzer-4706306762997760 Fixes: 7672/clusterfuzz-testcase-ffmpeg_AV_CODEC_ID_EAC3_fuzzer-4702108499574784 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 f77eee67e25b13e32e899efb6fdf01719914353e) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/ac3dec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c
index b14d2e74ac..1d3180b935 100644
--- a/libavcodec/ac3dec.c
+++ b/libavcodec/ac3dec.c
@@ -1800,6 +1800,9 @@ dependent_frame:
*got_frame_ptr = 1;
+ if (!s->superframe_size)
+ return FFMIN(full_buf_size, s->frame_size);
+
return FFMIN(full_buf_size, s->superframe_size);
}