Browse Source

Fix a typo that broke writing (and reading) PAM files.

Reported and reviewed by Derek Buitenhuis.
tags/n0.10
Carl Eugen Hoyos 13 years ago
parent
commit
c1bc1967f3
2 changed files with 4 additions and 2 deletions
  1. +1
    -1
      libavcodec/pamenc.c
  2. +3
    -1
      libavcodec/pnm.c

+ 1
- 1
libavcodec/pamenc.c View File

@@ -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);



+ 3
- 1
libavcodec/pnm.c View File

@@ -93,7 +93,9 @@ 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") ||
// FFmpeg used to write invalid files
!strcmp(buf1, "TUPLETYPE")) {
pnm_get(s, tuple_type, sizeof(tuple_type));
} else if (!strcmp(buf1, "ENDHDR")) {
break;


Loading…
Cancel
Save