X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Findeo4.c;h=3d3579d76b6e4ed61d3d8b66104cd21205c8dad9;hb=a247ac640df3da573cd661065bf53f37863e2b46;hp=15ad6f8afc69c79ee40a7ef5b90a60796c963b72;hpb=73d193d1d0ff62a029a905d1404c0fd357f4c880;p=ffmpeg diff --git a/libavcodec/indeo4.c b/libavcodec/indeo4.c index 15ad6f8afc6..3d3579d76b6 100644 --- a/libavcodec/indeo4.c +++ b/libavcodec/indeo4.c @@ -30,6 +30,7 @@ #define BITSTREAM_READER_LE #include "avcodec.h" #include "get_bits.h" +#include "libavutil/imgutils.h" #include "indeo4data.h" #include "internal.h" #include "ivi.h" @@ -178,6 +179,13 @@ static int decode_pic_hdr(IVI45DecContext *ctx, AVCodecContext *avctx) pic_conf.chroma_bands = 0; if (pic_conf.luma_bands) pic_conf.chroma_bands = decode_plane_subdivision(&ctx->gb); + + if (av_image_check_size2(pic_conf.pic_width, pic_conf.pic_height, avctx->max_pixels, AV_PIX_FMT_YUV410P, 0, avctx) < 0) { + av_log(avctx, AV_LOG_ERROR, "picture dimensions %d %d cannot be decoded\n", + pic_conf.pic_width, pic_conf.pic_height); + return AVERROR_INVALIDDATA; + } + ctx->is_scalable = pic_conf.luma_bands != 1 || pic_conf.chroma_bands != 1; if (ctx->is_scalable && (pic_conf.luma_bands != 4 || pic_conf.chroma_bands != 1)) { av_log(avctx, AV_LOG_ERROR, "Scalability: unsupported subdivision! Luma bands: %d, chroma bands: %d\n", @@ -695,7 +703,7 @@ static av_cold int decode_init(AVCodecContext *avctx) } -AVCodec ff_indeo4_decoder = { +const AVCodec ff_indeo4_decoder = { .name = "indeo4", .long_name = NULL_IF_CONFIG_SMALL("Intel Indeo Video Interactive 4"), .type = AVMEDIA_TYPE_VIDEO, @@ -705,4 +713,5 @@ AVCodec ff_indeo4_decoder = { .close = ff_ivi_decode_close, .decode = ff_ivi_decode_frame, .capabilities = AV_CODEC_CAP_DR1, + .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, };