From c94f9e854228e0ea00e1de8769d8d3f7cab84a55 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Fri, 9 Aug 2013 13:37:18 +0200 Subject: avutil/mem: Fix flipped condition Fixes return code and later null pointer dereference Found-by: Laurent Butti Signed-off-by: Michael Niedermayer --- libavutil/mem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- cgit v1.2.3