aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-08-09 13:37:18 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-08-09 13:47:10 +0200
commitc94f9e854228e0ea00e1de8769d8d3f7cab84a55 (patch)
tree3793b315d5433e9e2c98280244779541565a3323 /libavutil
parentf58cd2867a8af2eed13acdd21d067b48249b14a1 (diff)
downloadffmpeg-c94f9e854228e0ea00e1de8769d8d3f7cab84a55.tar.gz
avutil/mem: Fix flipped condition
Fixes return code and later null pointer dereference Found-by: Laurent Butti <laurentb@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/mem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavutil/mem.c b/libavutil/mem.c
index 76f6b65d1a..20dfd629a8 100644
--- a/libavutil/mem.c
+++ b/libavutil/mem.c
@@ -191,7 +191,7 @@ int av_reallocp_array(void *ptr, size_t nmemb, size_t size)
{
void **ptrptr = ptr;
*ptrptr = av_realloc_f(*ptrptr, nmemb, size);
- if (!*ptrptr && !(nmemb && size))
+ if (!*ptrptr && nmemb && size)
return AVERROR(ENOMEM);
return 0;
}