]> git.sesse.net Git - ffmpeg/commitdiff
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 b91c2fa391986e52620d93210896979ed5c04c74..f228b723ec717b193dae758a53ddffc980417d98 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);