[FFmpeg-devel] [PATCH] avfilter/src_movi: Free packet on decoder error

Stefano Sabatini stefasab at gmail.com
Tue Jun 25 10:25:35 CEST 2013


Typo in subject, you could write lavfi/movie while at it.

I suggest:
lavfi/movie: free packet on decoder in case of error

On date Tuesday 2013-06-25 03:20:46 +0200, Michael Niedermayer encoded:
> Prevents infinite loop, see Ticket2556
> 
> Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> ---
>  libavfilter/src_movie.c |    3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/libavfilter/src_movie.c b/libavfilter/src_movie.c
> index 058838a..bdbf69e 100644
> --- a/libavfilter/src_movie.c
> +++ b/libavfilter/src_movie.c
> @@ -514,6 +514,9 @@ static int movie_push_frame(AVFilterContext *ctx, unsigned out_id)
>      if (ret < 0) {
>          av_log(ctx, AV_LOG_WARNING, "Decode error: %s\n", av_err2str(ret));
>          av_frame_free(&movie->frame);
> +        av_free_packet(&movie->pkt0);

> +        pkt->size = 0; /* ready for next run */
> +        pkt->data = NULL;

movie->pkt0->size = 0;
movie->pkt0->data = NULL;

should be less confusing

>          return 0;
>      }
>      if (!ret)

LGTM, still can't figure out why the decoding error only happens with
movie and not e.g. with ffplay Stopwatch-256.png.
-- 
FFmpeg = Faithless Fanciful Maxi Peaceful Evangelical Geek


More information about the ffmpeg-devel mailing list