提交 66b9d706 编写于 作者: C Carl Eugen Hoyos 提交者: Janne Grunau

pam: Fix a typo that broke writing and reading PAM files.

Reported and reviewed by Derek Buitenhuis.
Signed-off-by: NJanne Grunau <janne-libav@jannau.net>
上级 20ea14d0
...@@ -78,7 +78,7 @@ static int pam_encode_frame(AVCodecContext *avctx, unsigned char *outbuf, ...@@ -78,7 +78,7 @@ static int pam_encode_frame(AVCodecContext *avctx, unsigned char *outbuf,
return -1; return -1;
} }
snprintf(s->bytestream, s->bytestream_end - s->bytestream, 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); w, h, depth, maxval, tuple_type);
s->bytestream += strlen(s->bytestream); s->bytestream += strlen(s->bytestream);
......
...@@ -93,7 +93,9 @@ int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s) ...@@ -93,7 +93,9 @@ int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s)
} else if (!strcmp(buf1, "MAXVAL")) { } else if (!strcmp(buf1, "MAXVAL")) {
pnm_get(s, buf1, sizeof(buf1)); pnm_get(s, buf1, sizeof(buf1));
maxval = strtol(buf1, NULL, 10); maxval = strtol(buf1, NULL, 10);
} else if (!strcmp(buf1, "TUPLETYPE")) { } else if (!strcmp(buf1, "TUPLTYPE") ||
/* libavcodec used to write invalid files */
!strcmp(buf1, "TUPLETYPE")) {
pnm_get(s, tuple_type, sizeof(tuple_type)); pnm_get(s, tuple_type, sizeof(tuple_type));
} else if (!strcmp(buf1, "ENDHDR")) { } else if (!strcmp(buf1, "ENDHDR")) {
break; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册