]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Print out some errors found during MS RLE decoding
authorkostya <kostya@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Sat, 6 Dec 2008 09:01:11 +0000 (09:01 +0000)
committerkostya <kostya@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Sat, 6 Dec 2008 09:01:11 +0000 (09:01 +0000)
git-svn-id: file:///var/local/repositories/ffmpeg/trunk@16012 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavcodec/msrledec.c

index f44b8b6d1250a78ea41231991c9a09251d9dfed8..ce3c56d4718116c3dd7d52896c3f2849466b9d43 100644 (file)
@@ -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;