summaryrefslogtreecommitdiff
path: root/libavcodec/mem.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/mem.c')
-rw-r--r--libavcodec/mem.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/mem.c b/libavcodec/mem.c
index 9eaa09ed62..6d0fadc290 100644
--- a/libavcodec/mem.c
+++ b/libavcodec/mem.c
@@ -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;