diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-03-01 04:28:23 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-05-16 16:00:21 +0200 |
commit | b541a79c99b8ff86229a3cf3e71a479e99a393b8 (patch) | |
tree | 61c5076b28189ea0bd3b8a1ac80af0ceb84a849a | |
parent | eca3cfe9c4bd2d83d47d03f295523f8ae57e0a37 (diff) | |
download | ffmpeg-b541a79c99b8ff86229a3cf3e71a479e99a393b8.tar.gz |
avcodec/vp56: Clear dimensions in case of failure in the middle of a resolution change
Similar code is used elsewhere in vp56 to force a more complete reinit in the future.
Fixes null pointer dereference
Fixes: 707/clusterfuzz-testcase-4717453097566208
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4bed06637729ab000b79250c67d53078300e37c4)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/vp56.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libavcodec/vp56.c b/libavcodec/vp56.c index b36c99fd33..52f2a7dae8 100644 --- a/libavcodec/vp56.c +++ b/libavcodec/vp56.c @@ -603,13 +603,18 @@ int ff_vp56_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, } ret = ff_get_buffer(avctx, p, AV_GET_BUFFER_FLAG_REF); - if (ret < 0) + if (ret < 0) { + if (res == VP56_SIZE_CHANGE) + ff_set_dimensions(avctx, 0, 0); return ret; + } if (avctx->pix_fmt == AV_PIX_FMT_YUVA420P) { av_frame_unref(s->alpha_context->frames[VP56_FRAME_CURRENT]); if ((ret = av_frame_ref(s->alpha_context->frames[VP56_FRAME_CURRENT], p)) < 0) { av_frame_unref(p); + if (res == VP56_SIZE_CHANGE) + ff_set_dimensions(avctx, 0, 0); return ret; } } |