diff options
author | Paul B Mahol <onemda@gmail.com> | 2022-07-01 10:06:15 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2022-07-03 15:16:31 +0200 |
commit | ff1450e449f848ad4b37b3cf448315ba4581364e (patch) | |
tree | 4c6e245afa51c3ec58bb0865ed27f2940acf4f4a /libavcodec/pnm_parser.c | |
parent | 33fe3b73c2d4dec674509de5dc48698895f0806b (diff) | |
download | ffmpeg-ff1450e449f848ad4b37b3cf448315ba4581364e.tar.gz |
avcodec: add PHM decoder and encoder
Diffstat (limited to 'libavcodec/pnm_parser.c')
-rw-r--r-- | libavcodec/pnm_parser.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/pnm_parser.c b/libavcodec/pnm_parser.c index 309bc76a24..6607ac7e7f 100644 --- a/libavcodec/pnm_parser.c +++ b/libavcodec/pnm_parser.c @@ -111,6 +111,8 @@ retry: } else { int ret = av_image_get_buffer_size(avctx->pix_fmt, avctx->width, avctx->height, 1); next = pnmctx.bytestream - pnmctx.bytestream_start + skip; + if (ret > 0 && pnmctx.half) + ret >>= 1; if (ret >= 0 && next + (uint64_t)ret <= INT_MAX) next += ret; } @@ -133,7 +135,8 @@ end: const AVCodecParser ff_pnm_parser = { .codec_ids = { AV_CODEC_ID_PGM, AV_CODEC_ID_PGMYUV, AV_CODEC_ID_PPM, - AV_CODEC_ID_PBM, AV_CODEC_ID_PAM, AV_CODEC_ID_PFM }, + AV_CODEC_ID_PBM, AV_CODEC_ID_PAM, AV_CODEC_ID_PFM, + AV_CODEC_ID_PHM }, .priv_data_size = sizeof(PNMParseContext), .parser_parse = pnm_parse, .parser_close = ff_parse_close, |