From 605bc45295e935786b53bb9156440e089f8512d2 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Wed, 21 Jun 2017 17:56:34 +0200 Subject: [PATCH] avcodec/cfhd: Fix undefined shift Fixes: runtime error: left shift of negative value -1 Fixes: 2303/clusterfuzz-testcase-minimized-5529675273076736 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer (cherry picked from commit 5a950f4e32a9756391f81987246d96b6549dd447) Signed-off-by: Michael Niedermayer --- libavcodec/cfhd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/cfhd.c b/libavcodec/cfhd.c index 2408dca385..1dc9292421 100644 --- a/libavcodec/cfhd.c +++ b/libavcodec/cfhd.c @@ -679,7 +679,7 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame, output = s->plane[plane].subband[0]; for (i = 0; i < lowpass_height * 2; i++) { for (j = 0; j < lowpass_width * 2; j++) - output[j] <<= 2; + output[j] *= 4; output += lowpass_width * 2; }