[FFmpeg-devel] [PATCH] lavc/qsv: suppress code scan complain
Li, Zhong
zhong.li at intel.com
Thu May 24 05:22:18 EEST 2018
> From: ffmpeg-devel [mailto:ffmpeg-devel-bounces at ffmpeg.org] On Behalf
> Of Mark Thompson
> Sent: Wednesday, May 9, 2018 10:39 PM
> To: ffmpeg-devel at ffmpeg.org
> Subject: Re: [FFmpeg-devel] [PATCH] lavc/qsv: suppress code scan complain
>
> On 09/05/18 07:13, Zhong Li wrote:
> > Suppress the complain "variables 'type' is used but maybe uninitialized".
> >
> > Signed-off-by: Zhong Li <zhong.li at intel.com>
> > ---
> > libavcodec/qsv.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c index
> > 45e1c25..b578da0 100644
> > --- a/libavcodec/qsv.c
> > +++ b/libavcodec/qsv.c
> > @@ -197,7 +197,7 @@ int ff_qsv_find_surface_idx(QSVFramesContext
> *ctx,
> > QSVFrame *frame)
> >
> > enum AVPictureType ff_qsv_map_pictype(int mfx_pic_type) {
> > - enum AVPictureType type;
> > + enum AVPictureType type = AV_PICTURE_TYPE_NONE;
> > switch (mfx_pic_type & 0x7) {
> > case MFX_FRAMETYPE_I:
> > if (mfx_pic_type & MFX_FRAMETYPE_S)
> >
>
> Might it be better to add a default case to the switch and assert that it's
> never reached? I think if the pic type doesn't hit one of the existing cases
> then something must be very broken.
Agree, I've updated it. Thanks for review and sorry for late reply.
>
> - Mark
More information about the ffmpeg-devel
mailing list