[FFmpeg-devel,2/6] avcodec/apedec: Check error flag after entropy_decode*

Submitted by Michael Niedermayer on Oct. 5, 2019, 9:41 p.m.

Details

Message ID 20191005214107.20093-2-michael@niedermayer.cc
State Accepted
Commit 926221ef84ec30cc2b497e12f582d758130e09c5
Headers show

Commit Message

Michael Niedermayer Oct. 5, 2019, 9:41 p.m.
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 <michael@niedermayer.cc>
---
 libavcodec/apedec.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Michael Niedermayer Oct. 15, 2019, 9:11 p.m.
On Sat, Oct 05, 2019 at 11:41:03PM +0200, Michael Niedermayer wrote:
> 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 <michael@niedermayer.cc>
> ---
>  libavcodec/apedec.c | 4 ++++
>  1 file changed, 4 insertions(+)

will apply this and the other ape patch 
the fuzzer found another case that is fixed by it


[...]

Patch hide | download patch | download mbox

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);