[FFmpeg-devel] [PATCH] avutil/frame: Assert that width/height/channels is 0 for the destination of av_frame*_ref()

Gonzalo ggarra13 at gmail.com
Wed Mar 9 02:24:55 CET 2016



El 08/03/16 a las 17:14, Michael Niedermayer escribiĆ³:
> diff --git a/libavutil/frame.c b/libavutil/frame.c
> index 5607206..dde32b0 100644
> --- a/libavutil/frame.c
> +++ b/libavutil/frame.c
> @@ -375,6 +375,9 @@ int av_frame_ref(AVFrame *dst, const AVFrame *src)
>   {
>       int i, ret = 0;
>   
> +    av_assert0(dst->width == 0 && dst->height == 0);
> +    av_assert0(dst->channels == 0);
> +
>       dst->format         = src->format;
>       dst->width          = src->width;
>       dst->height         = src->height;
Why does it matter what dst->width/height is originally?  They are 
overwritten right after.

-- 
Gonzalo GarramuƱo
ggarra13 at gmail.com



More information about the ffmpeg-devel mailing list