[Horus] Protection against buffer overflow

This commit is contained in:
Bertrand Songis
2016-11-21 18:40:22 +01:00
parent 34fa612f07
commit 4b84cd27b2
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -198,7 +198,8 @@ class BitmapBuffer: public BitmapBufferBase<uint16_t>
template<class T> template<class T>
void drawBitmap(coord_t x, coord_t y, const T * bmp, coord_t srcx=0, coord_t srcy=0, coord_t w=0, coord_t h=0, float scale=0) void drawBitmap(coord_t x, coord_t y, const T * bmp, coord_t srcx=0, coord_t srcy=0, coord_t w=0, coord_t h=0, float scale=0)
{ {
if (!bmp) return; if (!bmp || x >= width || y >= height)
return;
int srcw = bmp->getWidth(); int srcw = bmp->getWidth();
int srch = bmp->getHeight(); int srch = bmp->getHeight();
+1
View File
@@ -77,6 +77,7 @@ enum FontSizeIndex {
SPAREf_INDEX, SPAREf_INDEX,
}; };
#define STDSIZE (STDSIZE_INDEX << 8)
#define TINSIZE (TINSIZE_INDEX << 8) #define TINSIZE (TINSIZE_INDEX << 8)
#define SMLSIZE (SMLSIZE_INDEX << 8) #define SMLSIZE (SMLSIZE_INDEX << 8)
#define MIDSIZE (MIDSIZE_INDEX << 8) #define MIDSIZE (MIDSIZE_INDEX << 8)