add more check befor destory the buffer
Unified · Split
| @@ -143,7 +143,7 @@ out: · 142 unmodified lines | ||
| 143 | 143 | |
| 144 | 144 | void av_file_unmap(uint8_t *bufptr, size_t size) |
| 145 | 145 | { |
| 146 | − if (!size) | |
| 146 | + if (!size || !bufptr) | |
| 147 | 147 | return; |
| 148 | 148 | #if HAVE_MMAP |
| 149 | 149 | munmap(bufptr, size); |