diff options
author | Mans Rullgard <mans@mansr.com> | 2011-11-27 00:59:17 +0400 |
---|---|---|
committer | Mans Rullgard <mans@mansr.com> | 2011-11-27 02:53:47 +0400 |
commit | 8540dcfd7af14da4080770dfbfa997cffdd0878b (patch) | |
tree | 3fe128b01346161856d7081bf3be3dd41ad44664 /libavcodec/snowenc.c | |
parent | 0e55edcb57bc3104e704e55c8267c72426358c36 (diff) |
snow: fix integer overflows
The way these values are used, they should have an unsigned type.
A similar change was made for mpegvideo in cb66847.
Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'libavcodec/snowenc.c')
-rw-r--r-- | libavcodec/snowenc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c index 4926eef5d2..cd60c3a512 100644 --- a/libavcodec/snowenc.c +++ b/libavcodec/snowenc.c @@ -958,7 +958,8 @@ static av_always_inline int check_block(SnowContext *s, int mb_x, int mb_y, int const int b_stride= s->b_width << s->block_max_depth; BlockNode *block= &s->block[mb_x + mb_y * b_stride]; BlockNode backup= *block; - int rd, index, value; + unsigned value; + int rd, index; assert(mb_x>=0 && mb_y>=0); assert(mb_x<b_stride); @@ -1003,7 +1004,8 @@ static av_always_inline int check_4block_inter(SnowContext *s, int mb_x, int mb_ const int b_stride= s->b_width << s->block_max_depth; BlockNode *block= &s->block[mb_x + mb_y * b_stride]; BlockNode backup[4]= {block[0], block[1], block[b_stride], block[b_stride+1]}; - int rd, index, value; + unsigned value; + int rd, index; assert(mb_x>=0 && mb_y>=0); assert(mb_x<b_stride); |