X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Findeo3.c;h=3a8b8712bce557a02b3202b6f9d7f5520e099fa8;hb=90262f3fb4afe4b903888e45cc40e2116cb69683;hp=71d478c9fc5b98c0db1a95de8178f307c3a6323d;hpb=409e684e79b6ee0c511292326f09b13fe230e58e;p=ffmpeg diff --git a/libavcodec/indeo3.c b/libavcodec/indeo3.c index 71d478c9fc5..3a8b8712bce 100644 --- a/libavcodec/indeo3.c +++ b/libavcodec/indeo3.c @@ -171,7 +171,7 @@ static av_cold int allocate_frame_buffers(Indeo3DecodeContext *ctx, if (luma_width < 16 || luma_width > 640 || luma_height < 16 || luma_height > 480 || - luma_width & 3 || luma_height & 3) { + luma_width & 1 || luma_height & 1) { av_log(avctx, AV_LOG_ERROR, "Invalid picture dimensions: %d x %d!\n", luma_width, luma_height); return AVERROR_INVALIDDATA; @@ -203,10 +203,8 @@ static av_cold int allocate_frame_buffers(Indeo3DecodeContext *ctx, ctx->planes[p].buffers[0] = av_malloc(!p ? luma_size : chroma_size); ctx->planes[p].buffers[1] = av_malloc(!p ? luma_size : chroma_size); - if (!ctx->planes[p].buffers[0] || !ctx->planes[p].buffers[1]) { - free_frame_buffers(ctx); + if (!ctx->planes[p].buffers[0] || !ctx->planes[p].buffers[1]) return AVERROR(ENOMEM); - } /* fill the INTRA prediction lines with the middle pixel value = 64 */ memset(ctx->planes[p].buffers[0], 0x40, ctx->planes[p].pitch); @@ -1133,7 +1131,7 @@ static av_cold int decode_close(AVCodecContext *avctx) return 0; } -AVCodec ff_indeo3_decoder = { +const AVCodec ff_indeo3_decoder = { .name = "indeo3", .long_name = NULL_IF_CONFIG_SMALL("Intel Indeo 3"), .type = AVMEDIA_TYPE_VIDEO, @@ -1143,4 +1141,5 @@ AVCodec ff_indeo3_decoder = { .close = decode_close, .decode = decode_frame, .capabilities = AV_CODEC_CAP_DR1, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, };