aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-08-11 18:20:03 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-09-17 12:21:32 +0200
commit04db307c77c18b6e1832a086f676db0db9c152a7 (patch)
treefe1700305f1f544409f394e2a566ab0024ae296f
parent342d5c20ce0a48074043d630e68629600b59ebdd (diff)
downloadffmpeg-04db307c77c18b6e1832a086f676db0db9c152a7.tar.gz
avcodec/ffv1dec_template: Fix undefined shift
Fixes: runtime error: left shift of negative value -127 Fixes: 2834/clusterfuzz-testcase-minimized-5988039123795968 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 62702eebded6c6341d214405812a981f80e46ea2) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/ffv1dec_template.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/ffv1dec_template.c b/libavcodec/ffv1dec_template.c
index 892ccf22fa..f2f7432339 100644
--- a/libavcodec/ffv1dec_template.c
+++ b/libavcodec/ffv1dec_template.c
@@ -149,7 +149,7 @@ static void RENAME(decode_rgb_frame)(FFV1Context *s, uint8_t *src[3], int w, int
}
if (lbd)
- *((uint32_t*)(src[0] + x*4 + stride[0]*y)) = b + (g<<8) + (r<<16) + (a<<24);
+ *((uint32_t*)(src[0] + x*4 + stride[0]*y)) = b + ((unsigned)g<<8) + ((unsigned)r<<16) + ((unsigned)a<<24);
else if (sizeof(TYPE) == 4) {
*((uint16_t*)(src[0] + x*2 + stride[0]*y)) = g;
*((uint16_t*)(src[1] + x*2 + stride[1]*y)) = b;