[FFmpeg-cvslog] avutil/file: add more check befor destory the buffer

Jun Zhao git at videolan.org
Fri Aug 30 04:22:57 EEST 2019


ffmpeg | branch: master | Jun Zhao <barryjzhao at tencent.com> | Fri Aug 30 09:09:16 2019 +0800| [95780f4dcbf89f511e5d0c19035221cea0826d7d] | committer: Jun Zhao

avutil/file: add more check befor destory the buffer

add more check befor destory the buffer

Reviewed-by: Michael Niedermayer <michael at niedermayer.cc>
Signed-off-by: Jun Zhao <barryjzhao at tencent.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=95780f4dcbf89f511e5d0c19035221cea0826d7d
---

 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);



More information about the ffmpeg-cvslog mailing list