[Ffmpeg-devel] [PATCH] Replace av_malloc+memset with av_mallocz
Panagiotis Issaris
takis.issaris
Wed Sep 6 16:02:04 CEST 2006
Hi,
Op woensdag 6 september 2006 15:53, schreef Michael Niedermayer:
>[...]
> > 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.
>
> this isnt the whole story ...
> theres the issue with DOS attacks too (= files designed to cause OOM)
> so IMHO checking the sizes before alloc() if the size is specified in
> some input file is a good idea ...
But how would you do that? Check for the allocation of "really big"
blocks of memory? It doesn't seem that easy to me to define such a
maximum.
And moreover, would that be enough, wouldn't it be possible to construct
a file that makes FFmpeg do many smaller allocations, causing OOM?
With friendly regards,
Takis
More information about the ffmpeg-devel
mailing list