diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-07-01 15:43:50 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-07-01 15:53:15 +0200 |
commit | 53fd70579bc2314f2f5d528bed96914179b9a209 (patch) | |
tree | 3fe6c448cfb9548066a1adeae8f6761f163b0e14 | |
parent | ac78014f0b1f219a596d3c0cd803cf6b84191886 (diff) | |
download | ffmpeg-53fd70579bc2314f2f5d528bed96914179b9a209.tar.gz |
avcodec/h264_mvpred: Fix undefined shifts in MAP_F2F
Fixes: asan_heap-oob_17301a3_2100_cov_3226131691_ff_add_pixels_clamped_mmx.m2ts
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/h264_mvpred.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/h264_mvpred.h b/libavcodec/h264_mvpred.h index 57fa9b90ef..763746cc26 100644 --- a/libavcodec/h264_mvpred.h +++ b/libavcodec/h264_mvpred.h @@ -771,7 +771,7 @@ static void fill_decode_caches(const H264Context *h, H264SliceContext *sl, int m #define MAP_F2F(idx, mb_type) \ if (!IS_INTERLACED(mb_type) && sl->ref_cache[list][idx] >= 0) { \ - sl->ref_cache[list][idx] <<= 1; \ + sl->ref_cache[list][idx] *= 2; \ sl->mv_cache[list][idx][1] /= 2; \ sl->mvd_cache[list][idx][1] >>= 1; \ } @@ -783,7 +783,7 @@ static void fill_decode_caches(const H264Context *h, H264SliceContext *sl, int m #define MAP_F2F(idx, mb_type) \ if (IS_INTERLACED(mb_type) && sl->ref_cache[list][idx] >= 0) { \ sl->ref_cache[list][idx] >>= 1; \ - sl->mv_cache[list][idx][1] <<= 1; \ + sl->mv_cache[list][idx][1] *= 2; \ sl->mvd_cache[list][idx][1] <<= 1; \ } |