[FFmpeg-devel] [PATCH 19/23] dnn/dnn_backend_native_layer_conv2d: Check allocation

Guo, Yejun yejun.guo at intel.com
Thu Mar 11 09:28:54 EET 2021



> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf Of
> Andreas Rheinhardt
> Sent: 2021年3月11日 5:55
> To: ffmpeg-devel at ffmpeg.org
> Cc: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
> Subject: [FFmpeg-devel] [PATCH 19/23]
> dnn/dnn_backend_native_layer_conv2d: Check allocation
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
> ---
> Why does DNN actually not use the ordinary error codes?

DNN_ERROR/DNN_SUCCESS is introduced at the very beginning,
@Pedro any comment if we need to revisit the error code? thanks.

> 
>  libavfilter/dnn/dnn_backend_native_layer_conv2d.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/libavfilter/dnn/dnn_backend_native_layer_conv2d.c
> b/libavfilter/dnn/dnn_backend_native_layer_conv2d.c
> index 94a07c1fdb..941330c895 100644
> --- a/libavfilter/dnn/dnn_backend_native_layer_conv2d.c
> +++ b/libavfilter/dnn/dnn_backend_native_layer_conv2d.c
> @@ -228,6 +228,8 @@ int ff_dnn_execute_layer_conv2d(DnnOperand
> *operands, const int32_t *input_opera
> 
>  #if HAVE_PTHREAD_CANCEL
>      thread_param = av_calloc(thread_num, sizeof(*thread_param));
> +    if (!thread_param)
> +        return DNN_ERROR;

LGTM, thanks.



More information about the ffmpeg-devel mailing list