X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=libavcodec%2Findeo5.c;h=3de4a30ee20d685e0ee39f6e960da1ac9f478b58;hb=0181162bb54ce62ec212436a12d059726d8cd1df;hp=81b4514038ae42a26a76b2544558aaa794a3119d;hpb=68de778ccc35bea885a989e47358089da006a8b6;p=ffmpeg diff --git a/libavcodec/indeo5.c b/libavcodec/indeo5.c index 81b4514038a..3de4a30ee20 100644 --- a/libavcodec/indeo5.c +++ b/libavcodec/indeo5.c @@ -30,6 +30,7 @@ #define BITSTREAM_READER_LE #include "avcodec.h" #include "get_bits.h" +#include "internal.h" #include "ivi.h" #include "ivi_dsp.h" #include "indeo5data.h" @@ -264,7 +265,7 @@ static int decode_gop_header(IVI45DecContext *ctx, AVCodecContext *avctx) } if (get_bits1(&ctx->gb)) - skip_bits_long(&ctx->gb, 24); /* skip transparency fill color */ + skip_bits(&ctx->gb, 24); /* skip transparency fill color */ } align_get_bits(&ctx->gb); @@ -324,6 +325,7 @@ static int decode_pic_hdr(IVI45DecContext *ctx, AVCodecContext *avctx) ctx->frame_type = get_bits(&ctx->gb, 3); if (ctx->frame_type >= 5) { av_log(avctx, AV_LOG_ERROR, "Invalid frame type: %d \n", ctx->frame_type); + ctx->frame_type = FRAMETYPE_INTRA; return AVERROR_INVALIDDATA; } @@ -347,7 +349,7 @@ static int decode_pic_hdr(IVI45DecContext *ctx, AVCodecContext *avctx) if (ctx->frame_type != FRAMETYPE_NULL) { ctx->frame_flags = get_bits(&ctx->gb, 8); - ctx->pic_hdr_size = (ctx->frame_flags & 1) ? get_bits_long(&ctx->gb, 24) : 0; + ctx->pic_hdr_size = (ctx->frame_flags & 1) ? get_bits(&ctx->gb, 24) : 0; ctx->checksum = (ctx->frame_flags & 0x10) ? get_bits(&ctx->gb, 16) : 0; @@ -391,7 +393,7 @@ static int decode_band_hdr(IVI45DecContext *ctx, IVIBandDesc *band, return 0; } - band->data_size = (ctx->frame_flags & 0x80) ? get_bits_long(&ctx->gb, 24) : 0; + band->data_size = (ctx->frame_flags & 0x80) ? get_bits(&ctx->gb, 24) : 0; band->inherit_mv = band_flags & 2; band->inherit_qdelta = band_flags & 8; @@ -641,6 +643,8 @@ static av_cold int decode_init(AVCodecContext *avctx) IVI45DecContext *ctx = avctx->priv_data; int result; + ctx->gop_invalid = 1; + ff_ivi_init_static_vlc(); /* copy rvmap tables in our context so we can apply changes to them */ @@ -689,4 +693,5 @@ AVCodec ff_indeo5_decoder = { .close = ff_ivi_decode_close, .decode = ff_ivi_decode_frame, .capabilities = AV_CODEC_CAP_DR1, + .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, };