[FFmpeg-devel] [PATCH 2/6] avcodec/vaapi_h264: Do not store our error code in VASliceParameterBufferH264

Michael Niedermayer michael at niedermayer.cc
Fri Jul 12 23:37:08 EEST 2024


On Tue, Jul 09, 2024 at 06:11:54AM +0000, Xiang, Haihao wrote:
> On So, 2024-07-07 at 20:47 +0200, Michael Niedermayer wrote:
> > I am not sure this is possible (thus this requires review)
> > 
> > Fixes: CID1604570 Overflowed constant
> > 
> > Sponsored-by: Sovereign Tech Fund
> > Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> > ---
> >  libavcodec/vaapi_h264.c | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> > 
> > diff --git a/libavcodec/vaapi_h264.c b/libavcodec/vaapi_h264.c
> > index 398e92568c2..77819a64a4e 100644
> > --- a/libavcodec/vaapi_h264.c
> > +++ b/libavcodec/vaapi_h264.c
> > @@ -342,6 +342,10 @@ static int vaapi_h264_decode_slice(AVCodecContext *avctx,
> >      const H264SliceContext *sl  = &h->slice_ctx[0];
> >      VASliceParameterBufferH264 slice_param;
> >      int err;
> > +    int slice_type = ff_h264_get_slice_type(sl);
> > +
> > +    if (slice_type < 0)
> > +        return slice_type;
> 
> sl->slice_type should be one of AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B,
> AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_SP and AV_PICTURE_TYPE_SI when this callback
> function is called, I don't think the if statement is required. 

patch dropped, i will mark this as false positive

thanks


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

What does censorship reveal? It reveals fear. -- Julian Assange
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240712/6f6097c2/attachment.sig>


More information about the ffmpeg-devel mailing list