aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-02-21 03:05:32 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2017-08-23 13:15:16 +0200
commit7d47aad28b8e869908d8f740c27ab444d123176a (patch)
tree45e5cb35cc75723325faad22380bf911190eb536
parentad909cafe7e69f52e3ea4f5d575a565de482df9e (diff)
downloadffmpeg-7d47aad28b8e869908d8f740c27ab444d123176a.tar.gz
avcodec/rv40: Fix runtime error: left shift of negative value
Fixes: 630/clusterfuzz-testcase-6608718928019456 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 956472a3236cc8eaeba5147c55b51bde6005c898) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/rv40.c2
-rw-r--r--libavcodec/rv40dsp.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/rv40.c b/libavcodec/rv40.c
index 6a6cf5b023..0b5f3ff92f 100644
--- a/libavcodec/rv40.c
+++ b/libavcodec/rv40.c
@@ -188,7 +188,7 @@ static int rv40_decode_intra_types(RV34DecContext *r, GetBitContext *gb, int8_t
A = ptr[-r->intra_types_stride + 1]; // it won't be used for the last coefficient in a row
B = ptr[-r->intra_types_stride];
C = ptr[-1];
- pattern = A + (B << 4) + (C << 8);
+ pattern = A + B * (1 << 4) + C * (1 << 8);
for(k = 0; k < MODE2_PATTERNS_NUM; k++)
if(pattern == rv40_aic_table_index[k])
break;
diff --git a/libavcodec/rv40dsp.c b/libavcodec/rv40dsp.c
index 19b0e93696..95ba0a9259 100644
--- a/libavcodec/rv40dsp.c
+++ b/libavcodec/rv40dsp.c
@@ -449,7 +449,7 @@ static av_always_inline void rv40_weak_loop_filter(uint8_t *src,
if (u > 3 - (filter_p1 && filter_q1))
continue;
- t <<= 2;
+ t *= 1 << 2;
if (filter_p1 && filter_q1)
t += src[-2*step] - src[1*step];