forked from FFmpeg/FFmpeg
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:
parent
1cad7171dd
commit
67e285ceca
1 changed files with 4 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue