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

Pedro Arthur bygrandao at gmail.com
Thu Mar 11 14:43:07 EET 2021


Em qui., 11 de mar. de 2021 às 04:29, Guo, Yejun <yejun.guo at intel.com> escreveu:
>
>
>
> > -----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.

I believe it was used for dnn specific errors and at some point were
mixed with ordinary errors.
I agree we should use ordinary error codes for ordinary errors.

>
> >
> >  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