[Vorbis-dev] Out of memory handling?

xiphmont at xiph.org xiphmont at xiph.org
Wed Jan 18 02:03:26 PST 2012


2011/11/7 Gábor Kovács <picard at movelex.hu>:
> Hi,
>
> As far as I see in libvorbis most of the places where _ogg_malloc(),
> _ogg_realloc and _ogg_calloc() is called the return value is not checked for
> out of memory condition. Is there any plan to change this?

Yes, in fact, for embedded systems.

> For my use-case the application is not allowed to crash. So if libvorbis can
> not handle this condition, I guess I would need to preallocate a large
> enough custom memory heap for all kind of vorbis files and override the ogg
> allocation macros.

On most general purpose systems, mallocs can't return NULL unless the
heap is corrupted.  Of course, that's not true for embedded and
special use OSes, so the code is in fact scheduled to change.

Monty


More information about the Vorbis-dev mailing list