Permalink
Browse files

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>
  • Loading branch information...
1 parent f58cd28 commit c94f9e854228e0ea00e1de8769d8d3f7cab84a55 @michaelni michaelni committed Aug 9, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 libavutil/mem.c
View
2 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;
}

0 comments on commit c94f9e8

Please sign in to comment.