[FFmpeg-devel] [PATCH 1/2] avcodec/mobiclip: add missing flush

James Almer jamrial at gmail.com
Sun Sep 13 18:13:23 EEST 2020


On 9/10/2020 5:39 PM, Paul B Mahol wrote:
> Signed-off-by: Paul B Mahol <onemda at gmail.com>
> ---
>  libavcodec/mobiclip.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/libavcodec/mobiclip.c b/libavcodec/mobiclip.c
> index d147eddbae..c296ce3c78 100644
> --- a/libavcodec/mobiclip.c
> +++ b/libavcodec/mobiclip.c
> @@ -1389,6 +1389,14 @@ static int mobiclip_decode(AVCodecContext *avctx, void *data,
>      return 0;
>  }
>  
> +static void mobiclip_flush(AVCodecContext *avctx)
> +{
> +    MobiClipContext *s = avctx->priv_data;
> +
> +    for (int i = 0; i < 6; i++)
> +        av_frame_unref(s->pic[i]);

Shouldn't you also zero s->current_pic? It's used as an index for this
array.

> +}
> +
>  static av_cold int mobiclip_close(AVCodecContext *avctx)
>  {
>      MobiClipContext *s = avctx->priv_data;
> @@ -1421,6 +1429,7 @@ AVCodec ff_mobiclip_decoder = {
>      .priv_data_size = sizeof(MobiClipContext),
>      .init           = mobiclip_init,
>      .decode         = mobiclip_decode,
> +    .flush          = mobiclip_flush,
>      .close          = mobiclip_close,
>      .capabilities   = AV_CODEC_CAP_DR1,
>  };
> 



More information about the ffmpeg-devel mailing list