summaryrefslogtreecommitdiff
path: root/libavcodec/msrledec.c
diff options
context:
space:
mode:
authorAndreas Cadhalpun <andreas.cadhalpun@googlemail.com>2015-04-16 14:49:08 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-04-16 15:52:22 +0200
commitae6fd7300b4e9f81d3b5ba201096ffe7cccf26fb (patch)
treeb1a0338ca006b10c32554b77c9d0ba8dde392421 /libavcodec/msrledec.c
parented2a712750c3342e399a44f9c5c2bd278128c759 (diff)
msrledec: use signed pixel_ptr in msrle_decode_pal4
This fixes segmentation faults, when pic->linesize[0] is negative. In that case 'line * pic->linesize[0] + pixel_ptr' is treated as unsigned and wraps around. This reverts commit 7d78a964. The problem was introduced in commit f7e1367f, which should obsolete that commit. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/msrledec.c')
-rw-r--r--libavcodec/msrledec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/msrledec.c b/libavcodec/msrledec.c
index c738198f2c..9d05bc8fc5 100644
--- a/libavcodec/msrledec.c
+++ b/libavcodec/msrledec.c
@@ -36,7 +36,7 @@ static int msrle_decode_pal4(AVCodecContext *avctx, AVPicture *pic,
unsigned char rle_code;
unsigned char extra_byte, odd_pixel;
unsigned char stream_byte;
- unsigned int pixel_ptr = 0;
+ int pixel_ptr = 0;
int line = avctx->height - 1;
int i;