Skip to content
Permalink
Browse files Browse the repository at this point in the history
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
michaelni committed Aug 9, 2013
1 parent f58cd28 commit c94f9e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libavutil/mem.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit c94f9e8

Please sign in to comment.