X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fmdec.c;h=39efed69b1854cbb86a92fbc87f25d56d9ddc5d4;hb=e5af9203098a889f36b759652615046254d45102;hp=330b7612790ecacbbb716c21944844bec6257030;hpb=c2631dfd0a0a12050cc1765fd41702c5e93abee5;p=ffmpeg diff --git a/libavcodec/mdec.c b/libavcodec/mdec.c index 330b7612790..39efed69b18 100644 --- a/libavcodec/mdec.c +++ b/libavcodec/mdec.c @@ -27,6 +27,8 @@ * This is very similar to intra-only MPEG-1. */ +#include "libavutil/mem_internal.h" + #include "avcodec.h" #include "blockdsp.h" #include "bswapdsp.h" @@ -71,8 +73,6 @@ static inline int mdec_decode_block_intra(MDECContext *a, int16_t *block, int n) } else { component = (n <= 3 ? 0 : n - 4 + 1); diff = decode_dc(&a->gb, component); - if (diff >= 0xffff) - return AVERROR_INVALIDDATA; a->last_dc[component] += diff; block[0] = a->last_dc[component] * (1 << 3); } @@ -240,17 +240,6 @@ static av_cold int decode_init(AVCodecContext *avctx) return 0; } -#if HAVE_THREADS -static av_cold int decode_init_thread_copy(AVCodecContext *avctx) -{ - MDECContext * const a = avctx->priv_data; - - a->avctx = avctx; - - return 0; -} -#endif - static av_cold int decode_end(AVCodecContext *avctx) { MDECContext * const a = avctx->priv_data; @@ -261,7 +250,7 @@ static av_cold int decode_end(AVCodecContext *avctx) return 0; } -AVCodec ff_mdec_decoder = { +const AVCodec ff_mdec_decoder = { .name = "mdec", .long_name = NULL_IF_CONFIG_SMALL("Sony PlayStation MDEC (Motion DECoder)"), .type = AVMEDIA_TYPE_VIDEO, @@ -271,5 +260,5 @@ AVCodec ff_mdec_decoder = { .close = decode_end, .decode = decode_frame, .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, - .init_thread_copy = ONLY_IF_THREADS_ENABLED(decode_init_thread_copy) + .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, };