aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/apedec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-10-05 18:39:05 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-10-16 18:03:26 +0200
commit926221ef84ec30cc2b497e12f582d758130e09c5 (patch)
tree40bb26f49f21b47e71d4c0f5b24e98185c1f2b95 /libavcodec/apedec.c
parent1a0c584abc9709b1d11dbafef05d22e0937d7d19 (diff)
downloadffmpeg-926221ef84ec30cc2b497e12f582d758130e09c5.tar.gz
avcodec/apedec: Check error flag after entropy_decode*
Fixes: 17886/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5728165124636672 Fixes: 18131/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5710803432374272 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/apedec.c')
-rw-r--r--libavcodec/apedec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
index 3e2fffb850..9713735574 100644
--- a/libavcodec/apedec.c
+++ b/libavcodec/apedec.c
@@ -1364,6 +1364,8 @@ static void ape_unpack_mono(APEContext *ctx, int count)
}
ctx->entropy_decode_mono(ctx, count);
+ if (ctx->error)
+ return;
/* Now apply the predictor decoding */
ctx->predictor_decode_mono(ctx, count);
@@ -1387,6 +1389,8 @@ static void ape_unpack_stereo(APEContext *ctx, int count)
}
ctx->entropy_decode_stereo(ctx, count);
+ if (ctx->error)
+ return;
/* Now apply the predictor decoding */
ctx->predictor_decode_stereo(ctx, count);