summaryrefslogtreecommitdiff
path: root/libavcodec/msrledec.c
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2008-12-06 09:01:11 +0000
committerKostya Shishkov <kostya.shishkov@gmail.com>2008-12-06 09:01:11 +0000
commitce60c2d133876b2878b724cb512b81d4a149c72e (patch)
tree89f81c8b963afa8a686d307b6bead1354792cac9 /libavcodec/msrledec.c
parent56da1fd7d111a81237451baf9b531288b1ad5987 (diff)
Print out some errors found during MS RLE decoding
Originally committed as revision 16012 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/msrledec.c')
-rw-r--r--libavcodec/msrledec.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libavcodec/msrledec.c b/libavcodec/msrledec.c
index f44b8b6d12..ce3c56d471 100644
--- a/libavcodec/msrledec.c
+++ b/libavcodec/msrledec.c
@@ -145,8 +145,10 @@ static int msrle_decode_8_16_24_32(AVCodecContext *avctx, AVPicture *pic, int de
p2 = *src++;
if(p2 == 0) { //End-of-line
output = pic->data[0] + (--line) * pic->linesize[0];
- if (line < 0)
+ if (line < 0){
+ av_log(avctx, AV_LOG_ERROR, "Next line is beyond picture bounds\n");
return -1;
+ }
pos = 0;
continue;
} else if(p2 == 1) { //End-of-picture
@@ -155,8 +157,10 @@ static int msrle_decode_8_16_24_32(AVCodecContext *avctx, AVPicture *pic, int de
p1 = *src++;
p2 = *src++;
line -= p2;
- if (line < 0)
+ if (line < 0){
+ av_log(avctx, AV_LOG_ERROR, "Skip beyond picture bounds\n");
return -1;
+ }
pos += p1;
output = pic->data[0] + line * pic->linesize[0] + pos * (depth >> 3);
continue;