35 const uint8_t **poutbuf,
int *poutbuf_size,
36 const uint8_t *buf,
int buf_size)
83 }
else if (pnmctx.
type < 4) {
98 uint8_t *match = memchr(bs,
'\n', end-bs);
103 }
else if (
c ==
'P') {
114 if (ret >= 0 && next + (uint64_t)ret <= INT_MAX)
119 if (next > buf_size) {
130 *poutbuf_size = buf_size;
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert0(cond)
assert() equivalent, that is always enabled.
int av_image_get_buffer_size(enum AVPixelFormat pix_fmt, int width, int height, int align)
Return the size in bytes of the amount of data required to store an image with the given parameters.
int ff_combine_frame(ParseContext *pc, int next, const uint8_t **buf, int *buf_size)
Combine the (truncated) bitstream to a complete frame.
void ff_parse_close(AVCodecParserContext *s)
int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext *const s)
static int pnm_parse(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
AVCodecParser ff_pnm_parser
main external API structure.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
int width
picture width / height.
uint8_t * bytestream_start
int overread_index
the index into ParseContext.buffer of the overread bytes
int overread
the number of bytes which where irreversibly read from the next frame