aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/webp.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-05-10 18:37:49 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-05-17 20:35:20 +0200
commitee12581551293fbd71fd37f013bf80fce754750d (patch)
tree6ce6e06a16dcce360e744598b6b97c0c3cc06950 /libavcodec/webp.c
parent3812e40894d5f21292456ed16d0b3d8f558a0184 (diff)
downloadffmpeg-ee12581551293fbd71fd37f013bf80fce754750d.tar.gz
avcodec/webp: Always set pix_fmt
Fixes: out of array access Fixes: 1434/clusterfuzz-testcase-minimized-6314998085189632 Fixes: 1435/clusterfuzz-testcase-minimized-6483783723253760 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Reviewed-by: "Ronald S. Bultje" <rsbultje@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 6b5d3fb26fb4be48e4966e4b1d97c2165538d4ef) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/webp.c')
-rw-r--r--libavcodec/webp.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libavcodec/webp.c b/libavcodec/webp.c
index a3b1fad6cd..26853d2bd2 100644
--- a/libavcodec/webp.c
+++ b/libavcodec/webp.c
@@ -1327,9 +1327,8 @@ static int vp8_lossy_decode_frame(AVCodecContext *avctx, AVFrame *p,
if (!s->initialized) {
ff_vp8_decode_init(avctx);
s->initialized = 1;
- if (s->has_alpha)
- avctx->pix_fmt = AV_PIX_FMT_YUVA420P;
}
+ avctx->pix_fmt = s->has_alpha ? AV_PIX_FMT_YUVA420P : AV_PIX_FMT_YUV420P;
s->lossless = 0;
if (data_size > INT_MAX) {