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

Guo, Yejun yejun.guo at intel.com
Fri Jun 18 16:45:19 EEST 2021



> -----Original Message-----
> From: Guo, Yejun <yejun.guo at intel.com>
> Sent: 2021年6月13日 22:43
> To: ffmpeg-devel at ffmpeg.org
> Cc: Guo, Yejun <yejun.guo at 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.



More information about the ffmpeg-devel mailing list