Fixes: Timeout (? -> 2sec)
Fixes: 
17886/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5728165124636672

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>
---
 libavcodec/apedec.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
index 9713735574..c6754a5ee6 100644
--- a/libavcodec/apedec.c
+++ b/libavcodec/apedec.c
@@ -609,6 +609,10 @@ static void decode_array_0000(APEContext *ctx, 
GetBitContext *gb,
     ksummax = 1 << rice->k + 7;
     ksummin = rice->k ? (1 << rice->k + 6) : 0;
     for (; i < blockstodecode; i++) {
+        if (get_bits_left(&ctx->gb) < 1) {
+            ctx->error = 1;
+            return ;
+        }
         out[i] = get_rice_ook(&ctx->gb, rice->k);
         rice->ksum += out[i] - out[i - 64];
         while (rice->ksum < ksummin) {
-- 
2.23.0

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to