aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMans Rullgard <mans@mansr.com>2011-10-08 15:03:51 +0100
committerReinhard Tartler <siretart@tauware.de>2012-03-18 17:50:35 +0100
commitfdc669fcbb855a35fcc0352d3ab75064b85194a0 (patch)
tree39b02c3c9fd661867b079c92d405c5994cbccdff
parentfe3314a4137682bd7556d8c20798ea9e45f9863f (diff)
downloadffmpeg-fdc669fcbb855a35fcc0352d3ab75064b85194a0.tar.gz
vp8: fix signed overflows
In addition to avoiding undefined behaviour, an unsigned type makes more sense for packing multiple 8-bit values. Signed-off-by: Mans Rullgard <mans@mansr.com> (cherry picked from commit bb59156606e00057a706ed30165bc7329db3823f) Signed-off-by: Anton Khirnov <anton@khirnov.net>
-rw-r--r--libavcodec/vp8.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index 5e331c9856..7e82bbbe82 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -919,7 +919,8 @@ void intra_predict(VP8Context *s, uint8_t *dst[3], VP8Macroblock *mb,
int mb_x, int mb_y)
{
AVCodecContext *avctx = s->avctx;
- int x, y, mode, nnz, tr;
+ int x, y, mode, nnz;
+ uint32_t tr;
// for the first row, we need to run xchg_mb_border to init the top edge to 127
// otherwise, skip it if we aren't going to deblock
@@ -948,7 +949,7 @@ void intra_predict(VP8Context *s, uint8_t *dst[3], VP8Macroblock *mb,
// from the top macroblock
if (!(!mb_y && avctx->flags & CODEC_FLAG_EMU_EDGE) &&
mb_x == s->mb_width-1) {
- tr = tr_right[-1]*0x01010101;
+ tr = tr_right[-1]*0x01010101u;
tr_right = (uint8_t *)&tr;
}