[FFmpeg-devel] [PATCH]Fix pam files

Carl Eugen Hoyos cehoyos at ag.or.at
Wed Dec 28 05:10:59 CET 2011


Hi!

As Derek kindly pointed out, there is a tiny bug in pam writing / reading.

Please comment, Carl Eugen
-------------- next part --------------
diff --git a/libavcodec/pamenc.c b/libavcodec/pamenc.c
index d9d849e..28fe7e1 100644
--- a/libavcodec/pamenc.c
+++ b/libavcodec/pamenc.c
@@ -78,7 +78,7 @@ static int pam_encode_frame(AVCodecContext *avctx, unsigned char *outbuf,
         return -1;
     }
     snprintf(s->bytestream, s->bytestream_end - s->bytestream,
-             "P7\nWIDTH %d\nHEIGHT %d\nDEPTH %d\nMAXVAL %d\nTUPLETYPE %s\nENDHDR\n",
+             "P7\nWIDTH %d\nHEIGHT %d\nDEPTH %d\nMAXVAL %d\nTUPLTYPE %s\nENDHDR\n",
              w, h, depth, maxval, tuple_type);
     s->bytestream += strlen(s->bytestream);
 
diff --git a/libavcodec/pnm.c b/libavcodec/pnm.c
index dfc18d6..b3a81a5 100644
--- a/libavcodec/pnm.c
+++ b/libavcodec/pnm.c
@@ -93,7 +93,7 @@ int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s)
             } else if (!strcmp(buf1, "MAXVAL")) {
                 pnm_get(s, buf1, sizeof(buf1));
                 maxval = strtol(buf1, NULL, 10);
-            } else if (!strcmp(buf1, "TUPLETYPE")) {
+            } else if (!strcmp(buf1, "TUPLTYPE")) {
                 pnm_get(s, tuple_type, sizeof(tuple_type));
             } else if (!strcmp(buf1, "ENDHDR")) {
                 break;


More information about the ffmpeg-devel mailing list