aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-02-22 00:42:23 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2017-02-22 02:42:48 +0100
commit24f6559bd2417b30c848d27523c88949d537a83c (patch)
treec3c256ecbf514ac11ac4f5e5859a83d248203e74 /libavcodec
parent1ad60e4e70ecc71b1301bdc041fa133129338393 (diff)
downloadffmpeg-24f6559bd2417b30c848d27523c88949d537a83c.tar.gz
avcodec/rv34: Fix runtime error: signed integer overflow: -2 + -2147483648 cannot be represented in type 'int'
Fixes: 642/clusterfuzz-testcase-558358808074649 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/rv34.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/rv34.c b/libavcodec/rv34.c
index aca8382f20..f1c93cffa4 100644
--- a/libavcodec/rv34.c
+++ b/libavcodec/rv34.c
@@ -866,6 +866,11 @@ static int rv34_decode_mv(RV34DecContext *r, int block_type)
for(i = 0; i < num_mvs[block_type]; i++){
r->dmv[i][0] = get_interleaved_se_golomb(gb);
r->dmv[i][1] = get_interleaved_se_golomb(gb);
+ if (r->dmv[i][0] == INVALID_VLC ||
+ r->dmv[i][1] == INVALID_VLC) {
+ r->dmv[i][0] = r->dmv[i][1] = 0;
+ return AVERROR_INVALIDDATA;
+ }
}
switch(block_type){
case RV34_MB_TYPE_INTRA: