various security fixes and precautionary checks

Originally committed as revision 3822 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Michael Niedermayer
2005-01-12 00:16:25 +00:00
parent f14d4e7e21
commit 0ecca7a49f
36 changed files with 314 additions and 89 deletions

View File

@@ -45,6 +45,10 @@
void *av_malloc(unsigned int size)
{
void *ptr;
/* lets disallow possible ambiguous cases */
if(size > INT_MAX)
return NULL;
#ifdef MEMALIGN_HACK
int diff;
@@ -93,6 +97,10 @@ void *av_malloc(unsigned int size)
*/
void *av_realloc(void *ptr, unsigned int size)
{
/* lets disallow possible ambiguous cases */
if(size > INT_MAX)
return NULL;
#ifdef MEMALIGN_HACK
//FIXME this isnt aligned correctly though it probably isnt needed
int diff;