Update GUI_BMPfile.c
This is present in all GUI_BMPFiles. It causes a segfault. You don't need to multiply the index by 4, C takes care of this for you already. The previous code will write beyond the bounds of the array.
This commit is contained in:
parent
f8a1f32638
commit
3afa0a3ad6
1 changed files with 1 additions and 1 deletions
|
|
@ -84,7 +84,7 @@ UBYTE GUI_ReadBmp(const char *path, UWORD Xstart, UWORD Ystart)
|
||||||
BMPRGBQUAD bmprgbquad[bmprgbquadsize]; //palette
|
BMPRGBQUAD bmprgbquad[bmprgbquadsize]; //palette
|
||||||
|
|
||||||
for(i = 0; i < bmprgbquadsize; i++){
|
for(i = 0; i < bmprgbquadsize; i++){
|
||||||
fread(&bmprgbquad[i * 4], sizeof(BMPRGBQUAD), 1, fp);
|
fread(&bmprgbquad[i], sizeof(BMPRGBQUAD), 1, fp);
|
||||||
}
|
}
|
||||||
if(bmprgbquad[0].rgbBlue == 0xff && bmprgbquad[0].rgbGreen == 0xff && bmprgbquad[0].rgbRed == 0xff){
|
if(bmprgbquad[0].rgbBlue == 0xff && bmprgbquad[0].rgbGreen == 0xff && bmprgbquad[0].rgbRed == 0xff){
|
||||||
Bcolor = BLACK;
|
Bcolor = BLACK;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue