From 4016b55332f1d3ff824be547e7b0ad59cf8b0d6a Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Thu, 28 Jan 2016 01:47:45 +0100 Subject: [PATCH] CFrameBuffer::paintBoxRel: Fix segfault in standby mode and fix segfault when paintBoxRel2Buf() returns NULL Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/86278623a6e9c5a99b5720c5a5c5189fa55989d9 Author: Michael Liebmann Date: 2016-01-28 (Thu, 28 Jan 2016) Origin message was: ------------------ CFrameBuffer::paintBoxRel: Fix segfault in standby mode and fix segfault when paintBoxRel2Buf() returns NULL ------------------ This commit was generated by Migit --- src/driver/framebuffer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/driver/framebuffer.cpp b/src/driver/framebuffer.cpp index dba43f397..d5a6a6ad3 100644 --- a/src/driver/framebuffer.cpp +++ b/src/driver/framebuffer.cpp @@ -730,6 +730,9 @@ fb_pixel_t* CFrameBuffer::paintBoxRel(const int x, const int y, const int dx, co const fb_pixel_t /*col*/, gradientData_t *gradientData, int radius, int type) { + if (!getActive()) + return NULL; + fb_pixel_t MASK = 0xFFFFFFFF; int _dx = dx; int w_align; @@ -754,6 +757,8 @@ fb_pixel_t* CFrameBuffer::paintBoxRel(const int x, const int y, const int dx, co #endif fb_pixel_t* boxBuf = paintBoxRel2Buf(_dx, dy, w_align, offs_align, MASK, NULL, radius, type); + if (boxBuf == NULL) + return NULL; fb_pixel_t *bp = boxBuf; fb_pixel_t *gra = gradientData->gradientBuf; gradientData->boxBuf = boxBuf;