Message ID | 20210613144304.3258-1-yejun.guo@intel.com |
---|---|
State | Accepted |
Commit | 2cf95f2dd96264586b703e7ea32e41df61497b60 |
Headers | show |
Series | [FFmpeg-devel] lavfi/dnn_backend_openvino.c: fix crash when target is not specified | expand |
Context | Check | Description |
---|---|---|
andriy/x86_make | success | Make finished |
andriy/x86_make_fate | success | Make fate finished |
andriy/PPC64_make | success | Make finished |
andriy/PPC64_make_fate | success | Make fate finished |
> -----Original Message----- > From: Guo, Yejun <yejun.guo@intel.com> > Sent: 2021年6月13日 22:43 > To: ffmpeg-devel@ffmpeg.org > Cc: Guo, Yejun <yejun.guo@intel.com> > Subject: [PATCH] lavfi/dnn_backend_openvino.c: fix crash when target is not > specified > > --- > 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)); Will push tomorrow if there's no objection, thanks.
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));