[FFmpeg-devel] [PATCH 2/2] vf_paletteuse: Don't free the second frame from ff_framesync_dualinput_get_writable on error

Clément Bœsch u at pkh.me
Tue Jan 2 23:53:47 EET 2018


On Mon, Jan 01, 2018 at 11:28:37AM -0500, Derek Buitenhuis wrote:
> This fixes a double free in he error case.
> 
> Signed-off-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>
> ---
> This does fix the double free, but I am unsure if it is the correct free
> to removed to fix it. Comments welcome.
> ---
>  libavfilter/vf_paletteuse.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/libavfilter/vf_paletteuse.c b/libavfilter/vf_paletteuse.c
> index ede2e2e..c2d0c6b 100644
> --- a/libavfilter/vf_paletteuse.c
> +++ b/libavfilter/vf_paletteuse.c
> @@ -1037,7 +1037,6 @@ static int load_apply_palette(FFFrameSync *fs)
>  
>  error:
>      av_frame_free(&master);
> -    av_frame_free(&second);
>      return ret;
>  }

That's some weird ownership semantic for the error-path, but Nicolas knows
better this API so I'll trust him on this one.

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180102/e59b9e3c/attachment.sig>


More information about the ffmpeg-devel mailing list