From add87291941726f8daa9e06e5aaf330bd8e239f3 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 14 Jul 2012 21:43:36 +0200 Subject: [PATCH] framebuffer: add sanity check in paintPixel Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5abc54f429422245c97d32e3b4823699774e1057 Author: Stefan Seyfried Date: 2012-07-14 (Sat, 14 Jul 2012) --- src/driver/framebuffer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/driver/framebuffer.cpp b/src/driver/framebuffer.cpp index d5d6723c5..e6c8de1bf 100644 --- a/src/driver/framebuffer.cpp +++ b/src/driver/framebuffer.cpp @@ -1279,6 +1279,8 @@ void CFrameBuffer::paintPixel(const int x, const int y, const fb_pixel_t col) #ifdef USE_NEVIS_GXA paintHLineRel(x, 1, y, col); #else + if (x > xRes || y > yRes || x < 0 || y < 0) + return; fb_pixel_t * pos = getFrameBufferPointer(); pos += (stride / sizeof(fb_pixel_t)) * y; pos += x;