[FFmpeg-devel] [PATCH] Check for invalid VLC code in zeros_left before writing coefficients.

Michael Niedermayer michaelni at gmx.at
Sun Dec 9 17:43:31 CET 2012

On Sun, Dec 09, 2012 at 07:52:33AM -0800, Ronald S. Bultje wrote:
> Hi,
> On Sun, Dec 9, 2012 at 4:05 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
> > Hi
> >
> > On Fri, Dec 07, 2012 at 01:09:20PM -0800, Ronald S. Bultje wrote:
> >> From: "Ronald S. Bultje" <rsbultje at gmail.com>
> >>
> >> This prevents an invalid write into coeffs[scantable[-1]] if zeros_left
> >> itself was an invalid VLC code (and thus -1).
> >
> > scantable[-1] has to be a value between 0 and 255 as its uint8_t
> > coeffs is supposed to be at least 256 entries large for exactly that
> > reason
> Accessing scantable[-1] is no less valid depending on the type of scantable.

the scantable is part of a larger structure, and *(scantable-1)
always points inside the structure and allocated memory.

> But do as you wish.

If you see a problem with the code, please elaborate.

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121209/43ce2e57/attachment.asc>

More information about the ffmpeg-devel mailing list