mem: Handle av_reallocp(..., 0) properly

Previously this did a double free (and returned an error).

Reported-by: Justin Ruggles
Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
Martin Storsjö 2013-09-20 14:02:41 +03:00
parent 1cad7171dd
commit 67e285ceca

View File

@ -141,6 +141,10 @@ int av_reallocp(void *ptr, size_t size)
void **ptrptr = ptr;
void *ret;
if (!size) {
av_freep(ptr);
return 0;
}
ret = av_realloc(*ptrptr, size);
if (!ret) {