diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-08-09 15:37:18 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-08-09 15:47:10 +0400 |
commit | c94f9e854228e0ea00e1de8769d8d3f7cab84a55 (patch) | |
tree | 3793b315d5433e9e2c98280244779541565a3323 | |
parent | f58cd2867a8af2eed13acdd21d067b48249b14a1 (diff) |
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>
-rw-r--r-- | libavutil/mem.c | 2 |
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; } |