[FFmpeg-cvslog] dnn/dnn_backend_native_layer_conv2d: Check allocation

Andreas Rheinhardt git at videolan.org
Thu Mar 11 15:05:06 EET 2021


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at gmail.com> | Wed Mar 10 17:42:43 2021 +0100| [c2fef8f16cf35c6eb58565d9e4bf25389637d850] | committer: Andreas Rheinhardt

dnn/dnn_backend_native_layer_conv2d: Check allocation

Reviewed-by: Guo, Yejun <yejun.guo at intel.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c2fef8f16cf35c6eb58565d9e4bf25389637d850
---

 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 37834d09f4..f3e9ce3fd9 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_malloc_array(thread_num, sizeof(*thread_param));
+    if (!thread_param)
+        return DNN_ERROR;
     thread_stride = (height - pad_size * 2) / thread_num;
     //create threads
     for (int i = 0; i < thread_num; i++){



More information about the ffmpeg-cvslog mailing list