Commit 67e285ce authored by Martin Storsjö's avatar Martin Storsjö

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

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

Reported-by: Justin Ruggles
Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
parent 1cad7171
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment