提交 c5566f0a 编写于 作者: C Clément Bœsch

lavc/pnm_parser: disable parsing for text based PNMs

P1, P2, and P3 are respectively the text versions of PBM, PGM and PPM
files.

We can not obtain the buffer size using av_imgage_get_buffer_size() as
every pixel in the picture will occupy a random size between 16 and 32
bits ("4 " and "231 " are such example).

Ideally, we could look for the next header (or EOF) in the bytestream,
but this commit is meant to fix a decoding regression introduced by
48ac4532.

Fix Ticket #5670
上级 0acc170a
......@@ -66,6 +66,8 @@ retry:
}
#endif
next = END_NOT_FOUND;
} else if (pnmctx.type < 4) {
next = END_NOT_FOUND;
} else {
next = pnmctx.bytestream - pnmctx.bytestream_start
+ av_image_get_buffer_size(avctx->pix_fmt, avctx->width, avctx->height, 1);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册