[FFmpeg-cvslog] msrledec: use signed pixel_ptr in msrle_decode_pal4

Andreas Cadhalpun git at videolan.org
Fri Apr 17 15:45:44 CEST 2015


ffmpeg | branch: release/2.5 | Andreas Cadhalpun <andreas.cadhalpun at googlemail.com> | Thu Apr 16 14:49:08 2015 +0200| [9a241d95efa1f6cc545a098160609fd3ba64d844] | committer: Michael Niedermayer

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 at googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit ae6fd7300b4e9f81d3b5ba201096ffe7cccf26fb)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9a241d95efa1f6cc545a098160609fd3ba64d844
---

 libavcodec/msrledec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/msrledec.c b/libavcodec/msrledec.c
index deb6f86..200221a 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;
 



More information about the ffmpeg-cvslog mailing list