avutil/file: add more check befor destory the buffer
authorJun Zhao <barryjzhao@tencent.com>
Fri, 30 Aug 2019 01:09:16 +0000 (09:09 +0800)
committerJun Zhao <barryjzhao@tencent.com>
Fri, 30 Aug 2019 01:16:01 +0000 (09:16 +0800)
add more check befor destory the buffer

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
libavutil/file.c

index b91c2fa..f228b72 100644 (file)
@@ -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);