[Horus] Protection against buffer overflow
This commit is contained in:
@@ -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();
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user