malloc (was Re: [MPlayer-dev-eng] [PATCH] fix stack usage in libvo/font_load_ft.c)

Uoti Urpala uoti.urpala at pp1.inet.fi
Fri Jul 28 16:18:18 CEST 2006


On Fri, 2006-07-28 at 17:49 +0200, Reimar Döffinger wrote:
> No time for a rewrite, applied with some modifications (e.g. the malloc
> fix returned without calling free if only one of the mallocs failed).

There's already lots of code that breaks if mallocs start failing, and
trying to recover from failed mallocs in MPlayer isn't worth the effort
IMO. I think wrapper functions for malloc/realloc that are guaranteed
not to return NULL would be useful (print an error and exit if the
memory cannot be allocated). Especially realloc returning NULL can even
be a security risk on some platforms because NULL[big_value] can be a
valid address.




More information about the MPlayer-dev-eng mailing list