aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-09-21 09:31:29 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-09-21 09:36:58 +0200
commit6c169c2fa4f3665c4535089e64f23af3e8200a11 (patch)
tree8ac7a2b32967bfb2ce0000d278dec56299ad5eb4
parent5b153f81645e9e5e88ffeee51ff3f414f70d8e05 (diff)
parent67e285ceca1cb602a5ab87010b30d904527924fe (diff)
downloadffmpeg-6c169c2fa4f3665c4535089e64f23af3e8200a11.tar.gz
Merge commit '67e285ceca1cb602a5ab87010b30d904527924fe'
* commit '67e285ceca1cb602a5ab87010b30d904527924fe': mem: Handle av_reallocp(..., 0) properly Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavutil/mem.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavutil/mem.c b/libavutil/mem.c
index 3da8c29889..a7f306a3a5 100644
--- a/libavutil/mem.c
+++ b/libavutil/mem.c
@@ -185,6 +185,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) {