On Tue, May 12, 2020 at 04:11:34PM +0200, Nicolas George wrote: > Marton Balint (12020-05-12): > > You mean this? > > > > #define FF_ALLOC_ARRAY_OR_ERROR(p, nelem, elsize, errstatement)\ > > {\ > > p = av_malloc_array(nelem, elsize);\ > > if (!p) {\ > > errstatement; \ > > }\ > > } > > Exactly. > > But I am rather in favor of making "something = AVERROR(ENOMEM)" > mandatory too: > > #define FF_ALLOC_ARRAY_OR_ERROR(p, nelem, elsize, ret, errstatement)\ > {\ > p = av_malloc_array(nelem, elsize);\ > if (!p) {\ > ret = AVERROR(ENOMEM); \ > errstatement; \ > }\ > }
OK, it's more clear, I got it. > > Regards, > > -- > Nicolas George > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe". -- Thanks, Limin Wang _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".