mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-30 17:01:08 +02:00
fb_generic: add sanity check and missing mark() to painIcon8
Origin commit data
------------------
Commit: ec40cf7986
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2017-02-12 (Sun, 12 Feb 2017)
This commit is contained in:
committed by
vanhofen
parent
8af59f8e99
commit
75355dda2b
@@ -744,6 +744,12 @@ bool CFrameBuffer::paintIcon8(const std::string & filename, const int x, const i
|
||||
width = (header.width_hi << 8) | header.width_lo;
|
||||
height = (header.height_hi << 8) | header.height_lo;
|
||||
|
||||
if (width > 768) {
|
||||
/* this is not going to happen, but check anyway */
|
||||
printf("%s: icon %s too wide (%d)\n", __func__, filename.c_str(), (int)width);
|
||||
close(lfd);
|
||||
return false;
|
||||
}
|
||||
unsigned char pixbuf[768];
|
||||
|
||||
uint8_t * d = ((uint8_t *)getFrameBufferPointer()) + x * sizeof(fb_pixel_t) + stride * y;
|
||||
@@ -764,6 +770,7 @@ bool CFrameBuffer::paintIcon8(const std::string & filename, const int x, const i
|
||||
d += stride;
|
||||
}
|
||||
close(lfd);
|
||||
mark(x, y, x + width, y + height);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user