[FFmpeg-devel] [PATCH] lavfi/dnn_backend_openvino.c: fix crash when target is not specified

Guo Yejun yejun.guo at intel.com
Sun Jun 13 17:43:04 EEST 2021


---
 libavfilter/dnn/dnn_backend_openvino.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavfilter/dnn/dnn_backend_openvino.c b/libavfilter/dnn/dnn_backend_openvino.c
index 709a772a4d..dee0a8e047 100644
--- a/libavfilter/dnn/dnn_backend_openvino.c
+++ b/libavfilter/dnn/dnn_backend_openvino.c
@@ -596,8 +596,10 @@ static DNNReturnType extract_inference_from_task(DNNFunctionType func_type, Task
             InferenceItem *inference;
             const AVDetectionBBox *bbox = av_get_detection_bbox(header, i);
 
-            if (av_strncasecmp(bbox->detect_label, params->target, sizeof(bbox->detect_label)) != 0) {
-                continue;
+            if (params->target) {
+                if (av_strncasecmp(bbox->detect_label, params->target, sizeof(bbox->detect_label)) != 0) {
+                    continue;
+                }
             }
 
             inference = av_malloc(sizeof(*inference));
-- 
2.17.1



More information about the ffmpeg-devel mailing list