[FFmpeg-devel] [PATCH] fix for malloc error (roundup issues 2480, 2479)
Mon Jan 3 19:22:00 CET 2011
On 03/01/11 18:01, Daniel Kang wrote:
> I am a Google Code-In student, and as part of a task, I have zzufed
> several files. It seems for extraordinary large total frames, ffmpeg
> fails on mallocating memory. Both bugs have been reproduced, so it is
> not only a bug on my box.
> The patches attached fix the issues locally. Another solution is to move
> the check into av_malloc, but that may create extra overhead. I am not
> sure what the best solution may be.
> Are there any suggestions?
That you misunderstand how (av_)malloc works and misunderstand how
malloc returns a block of size requested or NULL.
sizeof is a compile-time constant - it cannot tell you how many bytes
More information about the ffmpeg-devel