diff --git a/libarmbox/video.cpp b/libarmbox/video.cpp index 3151677..1aef0c4 100644 --- a/libarmbox/video.cpp +++ b/libarmbox/video.cpp @@ -1014,7 +1014,6 @@ void get_osd_size(int &xres, int &yres, int &bits_per_pixel) } void get_osd_buf(unsigned char *osd_data) { - unsigned char *lfb = NULL; struct fb_fix_screeninfo fix_screeninfo; struct fb_var_screeninfo var_screeninfo; @@ -1039,7 +1038,8 @@ void get_osd_buf(unsigned char *osd_data) return; } - if(!(lfb = (unsigned char*)mmap(0, fix_screeninfo.smem_len, PROT_READ | PROT_WRITE, 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"); close(fb);