Discussion:
[PATCH] lavc/qsv_overlay: suppress code scan complain
(too old to reply)
Zhong Li
2018-07-03 07:54:14 UTC
Permalink
Suppress the complain "variables 'pix_fmt' is used but maybe
uninitialized".

Signed-off-by: Zhong Li <***@intel.com>
---
libavfilter/vf_overlay_qsv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/vf_overlay_qsv.c b/libavfilter/vf_overlay_qsv.c
index 89f2fb1..33d50a5 100644
--- a/libavfilter/vf_overlay_qsv.c
+++ b/libavfilter/vf_overlay_qsv.c
@@ -162,7 +162,7 @@ release:

static int have_alpha_planar(AVFilterLink *link)
{
- enum AVPixelFormat pix_fmt;
+ enum AVPixelFormat pix_fmt = link->format;
const AVPixFmtDescriptor *desc;
AVHWFramesContext *fctx;
--
2.7.4
Maxym Dmytrychenko
2018-07-03 08:18:25 UTC
Permalink
should it be AV_PIX_FMT_NONE ?
Post by Zhong Li
Suppress the complain "variables 'pix_fmt' is used but maybe
uninitialized".
---
libavfilter/vf_overlay_qsv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavfilter/vf_overlay_qsv.c b/libavfilter/vf_overlay_qsv.c
index 89f2fb1..33d50a5 100644
--- a/libavfilter/vf_overlay_qsv.c
+++ b/libavfilter/vf_overlay_qsv.c
static int have_alpha_planar(AVFilterLink *link)
{
- enum AVPixelFormat pix_fmt;
+ enum AVPixelFormat pix_fmt = link->format;
const AVPixFmtDescriptor *desc;
AVHWFramesContext *fctx;
--
2.7.4
_______________________________________________
libav-devel mailing list
https://lists.libav.org/mailman/listinfo/libav-devel
Li, Zhong
2018-07-04 05:21:58 UTC
Permalink
IMHO, if link format is QSV, should pass from sw_format, else should pass from link->format direct.
Initializing it to be AV_PIX_FMT_NONE is approximate to un-initialization for non QSV format case.
-----Original Message-----
Maxym Dmytrychenko
Sent: Tuesday, July 3, 2018 4:18 PM
Subject: Re: [libav-devel] [PATCH] lavc/qsv_overlay: suppress code scan
complain
should it be AV_PIX_FMT_NONE ?
Post by Zhong Li
Suppress the complain "variables 'pix_fmt' is used but maybe
uninitialized".
---
libavfilter/vf_overlay_qsv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavfilter/vf_overlay_qsv.c
b/libavfilter/vf_overlay_qsv.c index 89f2fb1..33d50a5 100644
--- a/libavfilter/vf_overlay_qsv.c
+++ b/libavfilter/vf_overlay_qsv.c
static int have_alpha_planar(AVFilterLink *link) {
- enum AVPixelFormat pix_fmt;
+ enum AVPixelFormat pix_fmt = link->format;
const AVPixFmtDescriptor *desc;
AVHWFramesContext *fctx;
--
2.7.4
_______________________________________________
libav-devel mailing list
https://lists.libav.org/mailman/listinfo/libav-devel
_______________________________________________
libav-devel mailing list
https://lists.libav.org/mailman/listinfo/libav-devel
Continue reading on narkive:
Loading...