[FFmpeg-devel] [PATCH] oggparsevorbis: use av_realloc consistently

Michael Niedermayer michaelni at gmx.at
Fri Jan 11 14:54:13 CET 2013


On Thu, Jan 10, 2013 at 08:17:36PM +0100, Nicolas George wrote:
> Le primidi 21 nivôse, an CCXXI, Dale Curtis a écrit :
> > It's probably not only there, but it was the only one we detected in the
> > codecs used by Chrome.
> 
> Ok, that explains, but if there is really a problem, we will need to fix it
> completely. Can you explain exactly how the problem manifests itself.
> 
> (Single Unix does not tell anything about interactions between
> posix_memalign and realloc; nor does the GNU man page; the NetBSD man page
> states that they are compatible.)

Iam curious about this as well.
Is there an actual platform relevant to ffmpeg on which
posix_memalign() + realloc() fails ?

Also the "calloc, malloc, or realloc" Text has been removed from ISO C
C99:
Otherwise, if ptr does not match a pointer earlier returned by the
calloc, malloc, or realloc function, or if the space has been deallocated by a call
to the free or realloc function, the behavior is undefined. 

C11:
Otherwise, if ptr does not match a pointer earlier returned by a memory
management function, or if the space has been deallocated by a call to the free or
realloc function, the behavior is undefined.

mac osx seems to say:
     Memory that is allocated via posix_memalign() can be used as an argument in subsequent calls to
     realloc(3), reallocf(3), and free(3).  (Note however, that the allocation returned by realloc(3) or
     reallocf(3) is not guaranteed to preserve the original alignment).

dragonfly bsd seems to say:
    Memory that is allocated via posix_memalign() can be used as an argument
    in subsequent calls to realloc(3), reallocf(3), and free(3).


[...]

-- 
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: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130111/93c7f46a/attachment.asc>


More information about the ffmpeg-devel mailing list