[FFmpeg-devel] [PATCH 1/9] avcodec/vqcdec: Check init_get_bits8() for failure
Michael Niedermayer
michael at niedermayer.cc
Sun May 19 22:37:53 EEST 2024
On Sun, May 19, 2024 at 01:18:09PM +1000, Peter Ross wrote:
> On Sun, May 19, 2024 at 04:49:07AM +0200, Michael Niedermayer wrote:
> > Fixes: CID1516090 Unchecked return value
> >
> > Sponsored-by: Sovereign Tech Fund
> > Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> > ---
> > libavcodec/vqcdec.c | 5 ++++-
> > 1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/libavcodec/vqcdec.c b/libavcodec/vqcdec.c
> > index 5c6cab3c1ab..bb69844327d 100644
> > --- a/libavcodec/vqcdec.c
> > +++ b/libavcodec/vqcdec.c
> > @@ -147,10 +147,13 @@ static int decode_vectors(VqcContext * s, const uint8_t * buf, int size, int wid
> > GetBitContext gb;
> > uint8_t * vectors = s->vectors;
> > uint8_t * vectors_end = s->vectors + (width * height * 3) / 2;
> > + int ret;
> >
> > memset(vectors, 0, 3 * width * height / 2);
> >
> > - init_get_bits8(&gb, buf, size);
> > + ret = init_get_bits8(&gb, buf, size);
> > + if (ret < 0)
> > + return ret;
> >
> > for (int i = 0; i < 3 * width * height / 2 / 32; i++) {
> > uint8_t * dst = vectors;
>
> ok
will apply
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Concerning the gods, I have no means of knowing whether they exist or not
or of what sort they may be, because of the obscurity of the subject, and
the brevity of human life -- Protagoras
-------------- 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/20240519/3a3ebba9/attachment.sig>
More information about the ffmpeg-devel
mailing list