X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fgifdec.c;h=54f1d4c0ba7fdbf8129f21d535a731c8ccd6851d;hb=c8c81ac5026c20ce60860dc9aa905e5e1634bed1;hp=2eeed4c4c701b1e79af8dc4fdcbee107f86113ac;hpb=67e8f476b7d3c21686a2d453d052818ac92688b3;p=ffmpeg diff --git a/libavcodec/gifdec.c b/libavcodec/gifdec.c index 2eeed4c4c70..54f1d4c0ba7 100644 --- a/libavcodec/gifdec.c +++ b/libavcodec/gifdec.c @@ -451,6 +451,8 @@ static av_cold int gif_decode_init(AVCodecContext *avctx) if (!s->frame) return AVERROR(ENOMEM); ff_lzw_decode_open(&s->lzw); + if (!s->lzw) + return AVERROR(ENOMEM); return 0; } @@ -559,5 +561,7 @@ AVCodec ff_gif_decoder = { .close = gif_decode_close, .decode = gif_decode_frame, .capabilities = AV_CODEC_CAP_DR1, + .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | + FF_CODEC_CAP_INIT_CLEANUP, .priv_class = &decoder_class, };