diff options
author | Loren Merritt <lorenm@u.washington.edu> | 2005-12-30 23:47:41 +0000 |
---|---|---|
committer | Loren Merritt <lorenm@u.washington.edu> | 2005-12-30 23:47:41 +0000 |
commit | cec939597722663f322941b4c12e00a583e63504 (patch) | |
tree | 938bea17ebc479a05448813b77fe60585fd502aa /libavcodec/h264.c | |
parent | 003cd80df90e4e95652096783d3dc39b52e0b385 (diff) | |
download | ffmpeg-cec939597722663f322941b4c12e00a583e63504.tar.gz |
fix some potential arithmetic overflows in pred_direct_motion() and
ff_h264_weight_WxH_mmx2().
Originally committed as revision 4795 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r-- | libavcodec/h264.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 71b3909a6f..746cf01847 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -1286,8 +1286,8 @@ static inline void pred_direct_motion(H264Context * const h, int *mb_type){ } if(IS_16X16(*mb_type)){ - fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, ref[0], 1); - fill_rectangle(&h->ref_cache[1][scan8[0]], 4, 4, 8, ref[1], 1); + fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, (uint8_t)ref[0], 1); + fill_rectangle(&h->ref_cache[1][scan8[0]], 4, 4, 8, (uint8_t)ref[1], 1); if(!IS_INTRA(mb_type_col) && ( (l1ref0[0] == 0 && ABS(l1mv0[0][0]) <= 1 && ABS(l1mv0[0][1]) <= 1) || (l1ref0[0] < 0 && l1ref1[0] == 0 && ABS(l1mv1[0][0]) <= 1 && ABS(l1mv1[0][1]) <= 1 @@ -1315,8 +1315,8 @@ static inline void pred_direct_motion(H264Context * const h, int *mb_type){ fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, pack16to32(mv[0][0],mv[0][1]), 4); fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, pack16to32(mv[1][0],mv[1][1]), 4); - fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, ref[0], 1); - fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, ref[1], 1); + fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[0], 1); + fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[1], 1); /* col_zero_flag */ if(!IS_INTRA(mb_type_col) && ( l1ref0[x8 + y8*h->b8_stride] == 0 |