[FFmpeg-devel] [PATCH] avcodec: improve the function of FF_ALLOC{Z}{_ARRAY}_OR_GOTO

Limin Wang lance.lmwang at gmail.com
Wed May 13 02:05:04 EEST 2020


On Tue, May 12, 2020 at 07:58:29PM +0200, Nicolas George wrote:
> Marton Balint (12020-05-12):
> > And you assume that I want to assign the error code to ret. Wrong. What if I
> > want to return it as is?
> 
> Assign it to ret and forward ret.
> 
> >			   Or what if I want to return NULL beacuse the
> > function returns a pointer?
> 
> Bad design, fix it.

I have notice one such condition:
ff_iir_filter_init_coeffs() in iirfilter.c will return NULL without
error code.

> 
> >				Using variables is complicated. Constants make
> > the code more simple and readable.
> 
> Simpler now, much more complex later to fix the incorrect error codes.
> 
> Regards,
> 
> -- 
>   Nicolas George



> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".


-- 
Thanks,
Limin Wang


More information about the ffmpeg-devel mailing list