OSDN Git Service

pngdec: Print error if signature is wrong.
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 22 Feb 2012 02:36:36 +0000 (03:36 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 22 Feb 2012 02:37:18 +0000 (03:37 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/pngdec.c

index d4422c1..39afbdd 100644 (file)
@@ -407,8 +407,10 @@ static int decode_frame(AVCodecContext *avctx,
 
     /* check signature */
     if (memcmp(s->bytestream, ff_pngsig, 8) != 0 &&
-        memcmp(s->bytestream, ff_mngsig, 8) != 0)
+        memcmp(s->bytestream, ff_mngsig, 8) != 0) {
+        av_log(avctx, AV_LOG_ERROR, "Missing png signature\n");
         return -1;
+    }
     s->bytestream+= 8;
     s->y=
     s->state=0;