[FFmpeg-devel] [PATCH v2 1/4] avutil/internal: add FF_ALLOC_TYPED_ARRAY_OR_GOTO & FF_ALLOCZ_TYPED_ARRAY_OR_GOTO

Marton Balint cus at passwd.hu
Tue May 12 17:06:44 EEST 2020



On Tue, 12 May 2020, Nicolas George wrote:

> lance.lmwang at gmail.com (12020-05-12):
>> No, it's not hard-coded, you can name your own goto label.
>
> The label is not hard-coded. The goto is hard-coded. It should not be.
> Frequently, a return would be enough.


You mean this?

  #define FF_ALLOC_ARRAY_OR_ERROR(p, nelem, elsize, errstatement)\
  {\
      p = av_malloc_array(nelem, elsize);\
      if (!p) {\
          errstatement; \
      }\
  }

Regards,
Marton


More information about the ffmpeg-devel mailing list