From 95780f4dcbf89f511e5d0c19035221cea0826d7d Mon Sep 17 00:00:00 2001 From: Jun Zhao Date: Fri, 30 Aug 2019 09:09:16 +0800 Subject: [PATCH] avutil/file: add more check befor destory the buffer add more check befor destory the buffer Reviewed-by: Michael Niedermayer Signed-off-by: Jun Zhao --- libavutil/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavutil/file.c b/libavutil/file.c index b91c2fa391..f228b723ec 100644 --- a/libavutil/file.c +++ b/libavutil/file.c @@ -143,7 +143,7 @@ out: void av_file_unmap(uint8_t *bufptr, size_t size) { - if (!size) + if (!size || !bufptr) return; #if HAVE_MMAP munmap(bufptr, size);