mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-24 08:12:44 +00:00
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
@ -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…
Reference in New Issue
Block a user