X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Flagarith.c;h=69899e423e3baf9d32afb81b7bccf328b44a4239;hb=a247ac640df3da573cd661065bf53f37863e2b46;hp=59169be5dea5231324fd8149f333ae02d6df1059;hpb=c6892f59eb0e9f2a9ec1f55b21a5841a60540e1f;p=ffmpeg diff --git a/libavcodec/lagarith.c b/libavcodec/lagarith.c index 59169be5dea..69899e423e3 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,24 +712,13 @@ 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 = { +const AVCodec ff_lagarith_decoder = { .name = "lagarith", .long_name = NULL_IF_CONFIG_SMALL("Lagarith lossless"), .type = AVMEDIA_TYPE_VIDEO, .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, };