From 4c5b13c4a4578640742a934fa4a9533f87e4da6a Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 16 Apr 2019 23:15:57 +0200 Subject: [PATCH] fix check mmap error, avoid possible segment fault --- libarmbox/video.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libarmbox/video.cpp b/libarmbox/video.cpp index dcf064c..09304ee 100644 --- a/libarmbox/video.cpp +++ b/libarmbox/video.cpp @@ -1090,7 +1090,7 @@ void get_osd_buf(unsigned char *osd_data) return; } - void *lfb = (unsigned char*)mmap(0, fix_screeninfo.smem_len, PROT_READ , MAP_SHARED, fb, 0); + void *lfb = (unsigned char*)mmap(0, fix_screeninfo.smem_len, PROT_READ | PROT_WRITE, MAP_SHARED, fb, 0); if(lfb == MAP_FAILED) { fprintf(stderr, "Framebuffer: \n");