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

Andreas Rheinhardt andreas.rheinhardt at gmail.com
Wed Mar 10 23:54:42 EET 2021


Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
---
Why does DNN actually not use the ordinary error codes?

 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;
     thread_stride = (height - pad_size * 2) / thread_num;
     //create threads
     for (int i = 0; i < thread_num; i++){
-- 
2.27.0



More information about the ffmpeg-devel mailing list