Module: libav Branch: master Commit: 67e285ceca1cb602a5ab87010b30d904527924fe
Author: Martin Storsjö <[email protected]> Committer: Martin Storsjö <[email protected]> Date: Fri Sep 20 14:02:41 2013 +0300 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ö <[email protected]> --- libavutil/mem.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavutil/mem.c b/libavutil/mem.c index 172180e..b84020c 100644 --- a/libavutil/mem.c +++ b/libavutil/mem.c @@ -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) { _______________________________________________ libav-commits mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-commits
