[Ffmpeg-devel] [PATCH] Replace av_malloc+memset with av_mallocz

Guillaume Poirier gpoirier
Wed Sep 6 15:42:56 CEST 2006


Hi,

Panagiotis Issaris wrote:
> Hi,
> 
> Furthermore, these memory allocations together with several other spread through the
> project seem not to be checked for failure. Is that on purpose or are they 
> just not yet implemented?

AFAIK, it's because memory allocation fails, if a disaster occurs
(badly OOM for instance, ...) and means that my may be better off
killing the prgm as the OS will probably kill some prgm to free some
memory. So by not checking if allocation succeeds, you just guarantee
that in case of OOM, you will be killed by a segfault rather than
being killed by the kernel OOM killer.
I'm not sure which way is cleaner...

Guillaume




More information about the ffmpeg-devel mailing list