Browse Source

h264: fix signed overflows in x*0x01010101 expressions

Signed-off-by: Mans Rullgard <mans@mansr.com>
tags/n0.9
Mans Rullgard 14 years ago
parent
commit
4d1418cd4f
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      libavcodec/h264.c
  2. +1
    -1
      libavcodec/h264_mvpred.h

+ 1
- 1
libavcodec/h264.c View File

@@ -1668,7 +1668,7 @@ static av_always_inline void hl_decode_mb_predict_luma(H264Context *h, int mb_ty
tr_high= ((uint16_t*)ptr)[3 - linesize/2]*0x0001000100010001ULL; tr_high= ((uint16_t*)ptr)[3 - linesize/2]*0x0001000100010001ULL;
topright= (uint8_t*) &tr_high; topright= (uint8_t*) &tr_high;
} else { } else {
tr= ptr[3 - linesize]*0x01010101;
tr= ptr[3 - linesize]*0x01010101u;
topright= (uint8_t*) &tr; topright= (uint8_t*) &tr;
} }
}else }else


+ 1
- 1
libavcodec/h264_mvpred.h View File

@@ -588,7 +588,7 @@ static void fill_decode_caches(H264Context *h, int mb_type){
ref_cache[3 - 1*8]= ref[4*top_xy + 3]; ref_cache[3 - 1*8]= ref[4*top_xy + 3];
}else{ }else{
AV_ZERO128(mv_cache[0 - 1*8]); AV_ZERO128(mv_cache[0 - 1*8]);
AV_WN32A(&ref_cache[0 - 1*8], ((top_type ? LIST_NOT_USED : PART_NOT_AVAILABLE)&0xFF)*0x01010101);
AV_WN32A(&ref_cache[0 - 1*8], ((top_type ? LIST_NOT_USED : PART_NOT_AVAILABLE)&0xFF)*0x01010101u);
} }


if(mb_type & (MB_TYPE_16x8|MB_TYPE_8x8)){ if(mb_type & (MB_TYPE_16x8|MB_TYPE_8x8)){


Loading…
Cancel
Save