]> git.sesse.net Git - ffmpeg/commitdiff
dnn/dnn_backend_native_layer_conv2d: Check allocation
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Wed, 10 Mar 2021 16:42:43 +0000 (17:42 +0100)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Thu, 11 Mar 2021 12:10:46 +0000 (13:10 +0100)
Reviewed-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavfilter/dnn/dnn_backend_native_layer_conv2d.c

index 37834d09f4ab1c402e757de9ef6afad50caedf9f..f3e9ce3fd9847a2540171c9d42ef751fbc028b1a 100644 (file)
@@ -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++){