X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Flagarith.c;h=d81e55cf4ca1f60ec42f46a44edc10daa4181e56;hb=baecaa16c16dc2bca7ca15ed3c379d7343955adb;hp=59169be5dea5231324fd8149f333ae02d6df1059;hpb=92219ef4ac01b00e630b39cb19e8fbd17fdb63d0;p=ffmpeg diff --git a/libavcodec/lagarith.c b/libavcodec/lagarith.c index 59169be5dea..d81e55cf4ca 100644 --- a/libavcodec/lagarith.c +++ b/libavcodec/lagarith.c @@ -226,6 +226,9 @@ static int lag_read_prob_header(lag_rac *rac, GetBitContext *gb) } } + if (scale_factor > 23) + return AVERROR_INVALIDDATA; + rac->scale = scale_factor; /* Fill probability array with cumulative probability for each symbol. */ @@ -709,16 +712,6 @@ static av_cold int lag_decode_init(AVCodecContext *avctx) return 0; } -#if HAVE_THREADS -static av_cold int lag_decode_init_thread_copy(AVCodecContext *avctx) -{ - LagarithContext *l = avctx->priv_data; - l->avctx = avctx; - - return 0; -} -#endif - AVCodec ff_lagarith_decoder = { .name = "lagarith", .long_name = NULL_IF_CONFIG_SMALL("Lagarith lossless"), @@ -726,7 +719,6 @@ AVCodec ff_lagarith_decoder = { .id = AV_CODEC_ID_LAGARITH, .priv_data_size = sizeof(LagarithContext), .init = lag_decode_init, - .init_thread_copy = ONLY_IF_THREADS_ENABLED(lag_decode_init_thread_copy), .decode = lag_decode_frame, .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, };