[FFmpeg-devel] [PATCH] jpeg2000dec: simplify jpeg2000_read_bitstream_packets()

Michael Niedermayer michaelni at gmx.at
Wed Jul 24 14:14:01 CEST 2013


On Wed, Jul 24, 2013 at 11:39:53AM +0000, Paul B Mahol wrote:
> On 7/24/13, Michael Niedermayer <michaelni at gmx.at> wrote:
> > On Tue, Jul 23, 2013 at 10:21:27PM +0000, Carl Eugen Hoyos wrote:
> >> Michael Niedermayer <michaelni <at> gmx.at> writes:
> >>
> >> > +    atom_end  = bytestream2_tell(&s->g) + atom_size - 8;
> >>
> >> > +    if (bytestream2_get_bytes_left(&s->g) < atom_size ||
> >> > atom_end < atom_size)
> >>
> >> Could you explain what atom_end < atom_size is supposed
> >> to check?
> >
> > integer overflow
> 
> But isn't integer overflow undefined behavior, and thus checking
> result after overflow is not 100% safe?

its undefined for signed int, these are unsigned

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

If you think the mosad wants you dead since a long time then you are either
wrong or dead since a long time.
-------------- 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/20130724/459aa079/attachment.asc>


More information about the ffmpeg-devel mailing list