[FFmpeg-devel] [PATCH] lavf/mov.c: Allocate buffer in case of long metadata entries.

Nicolas George george at nsup.org
Mon Oct 13 13:08:57 CEST 2014


Le duodi 22 vendémiaire, an CCXXIII, Reimar Döffinger a écrit :
> Uh, wouldn't that be undefined behaviour?
> You're not allowed to compare pointers from different allocations as far
> as I know, even if it usually works.

The spec says:

# Two pointers compare equal if and only if both are null pointers, both are
# pointers to the same object (including a pointer to an object and a
# subobject at its beginning) or function, both are pointers to one past the
# last element of the same array object, or one is a pointer to one past the
# end of one array object and the other is a pointer to the start of a
# different array object that happens to immediately follow the first array
# object in the address space.)

If I read this correctly, the "and only if" means that comparing pointers
from different allocations is valid and returns false.

I suspect you are generalising the issue with < and >: for these operators,
comparing pointers to different objects is invalid.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20141013/cd9cf188/attachment.asc>


More information about the ffmpeg-devel mailing list