Remove extra whitespace, add size checks
This commit is contained in:
@@ -429,6 +429,8 @@ BH_Bitmap *BH_BitmapNew(uint32_t width,
|
|||||||
|
|
||||||
/* Get format information */
|
/* Get format information */
|
||||||
formatInfo = formats + (format & 0x0FFF);
|
formatInfo = formats + (format & 0x0FFF);
|
||||||
|
if ((format & 0x0FFF) > sizeof(formats) / sizeof(FormatInfo))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
/* Unset internal flags */
|
/* Unset internal flags */
|
||||||
flags &= ~BH_BITMAP_FLAG_EXT_DATA;
|
flags &= ~BH_BITMAP_FLAG_EXT_DATA;
|
||||||
@@ -674,6 +676,12 @@ void BH_BitmapConvertRow(void *src,
|
|||||||
srcInfo = formats + (srcFormat & 0x0FFF);
|
srcInfo = formats + (srcFormat & 0x0FFF);
|
||||||
destInfo = formats + (destFormat & 0x0FFF);
|
destInfo = formats + (destFormat & 0x0FFF);
|
||||||
|
|
||||||
|
if ((srcFormat & 0x0FFF) > sizeof(formats) / sizeof(FormatInfo))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ((destFormat & 0x0FFF) > sizeof(formats) / sizeof(FormatInfo))
|
||||||
|
return;
|
||||||
|
|
||||||
for (x = 0; count; --count, ++x)
|
for (x = 0; count; --count, ++x)
|
||||||
{
|
{
|
||||||
void *srcAt, *destAt;
|
void *srcAt, *destAt;
|
||||||
|
|||||||
Reference in New Issue
Block a user