]> git.sesse.net Git - ffmpeg/commitdiff
pcx: Consume the whole packet if giving up due to missing palette
authorMartin Storsjö <martin@martin.st>
Sat, 28 Sep 2013 21:38:50 +0000 (00:38 +0300)
committerMartin Storsjö <martin@martin.st>
Sun, 29 Sep 2013 17:01:29 +0000 (20:01 +0300)
Previously, we returned 0, meaning successful decoding but 0
bytes consumed, leading to an infinite loop.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
libavcodec/pcx.c

index a6f9d8d2626022b9b06d2e8cca8087c01589f60a..fd8bb2a6cbf1f832f8879264df8e5fd36236f054 100644 (file)
@@ -181,6 +181,7 @@ static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
         }
         if (*buf++ != 12) {
             av_log(avctx, AV_LOG_ERROR, "expected palette after image data\n");
+            ret = buf_size;
             goto end;
         }
     } else if (nplanes == 1) {   /* all packed formats, max. 16 colors */