X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Favs.c;h=05cb815fd884a58b90b36cb1d16395ad12889e4b;hb=c48883163d6c7ff0806687bf3ee33ca9f8e7dede;hp=cf965b38a03941f732b2e50b9c34eaabb670b02b;hpb=29582df797745fa6c5eec22b007e4fd3a47e7dd9;p=ffmpeg diff --git a/libavcodec/avs.c b/libavcodec/avs.c index cf965b38a03..05cb815fd88 100644 --- a/libavcodec/avs.c +++ b/libavcodec/avs.c @@ -85,8 +85,10 @@ avs_decode_frame(AVCodecContext * avctx, if (first >= 256 || last > 256 || buf_end - buf < 4 + 4 + 3 * (last - first)) return AVERROR_INVALIDDATA; buf += 4; - for (i=first; i> 6) & 0x30303; + } sub_type = buf[0]; type = buf[1]; @@ -163,6 +165,15 @@ static av_cold int avs_decode_init(AVCodecContext * avctx) return 0; } +static av_cold int avs_decode_end(AVCodecContext *avctx) +{ + AvsContext *s = avctx->priv_data; + if (s->picture.data[0]) + avctx->release_buffer(avctx, &s->picture); + return 0; +} + + AVCodec ff_avs_decoder = { .name = "avs", .type = AVMEDIA_TYPE_VIDEO, @@ -170,6 +181,7 @@ AVCodec ff_avs_decoder = { .priv_data_size = sizeof(AvsContext), .init = avs_decode_init, .decode = avs_decode_frame, + .close = avs_decode_end, .capabilities = CODEC_CAP_DR1, .long_name = NULL_IF_CONFIG_SMALL("AVS (Audio Video Standard) video"), };