[libav-devel] [PATCH 1/1] mpegvideo: synchronize AVFrame pointers in ERContext fully

Kostya Shishkov kostya.shishkov at gmail.com
Wed Jun 11 19:59:17 CEST 2014


On Wed, Jun 11, 2014 at 07:51:35PM +0200, Janne Grunau wrote:
> Since error resilience uses AVFrame pointers instead of references it
> has to copy NULL pointers too. After a codec flush the last/next frame
> pointers in MpegEncContext are NULL and the old pointers remaining in
> ERContext are invalid. Fixes a crash in vlc for android thumbnailer.
> Reported and debugged by Adrien Maglo <magsoft at videolan.org>.
> ---
>  libavcodec/mpegvideo.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
> index b2fcce2..ca5ee0b 100644
> --- a/libavcodec/mpegvideo.c
> +++ b/libavcodec/mpegvideo.c
> @@ -2473,8 +2473,11 @@ void ff_mpeg_set_erpic(ERPicture *dst, Picture *src)
>  {
>      int i;
>  
> -    if (!src)
> +    if (!src) {
> +         dst->f  = NULL;
> +         dst->tf = NULL;
>          return;
> +    }
>  
>      dst->f = src->f;
>      dst->tf = &src->tf;
> -- 

looks passable for this code


More information about the libav-devel mailing list