Fix for UBSAN error: left shift of negative value
This commit is contained in:
parent
01821d89b5
commit
b338d4a037
|
@ -315,9 +315,9 @@ FCEUFILE * FCEU_fopen(const char *path, const char *ipsfn, const char *mode, cha
|
||||||
{
|
{
|
||||||
uint32 magic;
|
uint32 magic;
|
||||||
|
|
||||||
magic = fp->fgetc();
|
magic = (fp->fgetc() & 0x00ff);
|
||||||
magic|=fp->fgetc()<<8;
|
magic|= (fp->fgetc() & 0x00ff) << 8;
|
||||||
magic|=fp->fgetc()<<16;
|
magic|= (fp->fgetc() & 0x00ff) << 16;
|
||||||
fp->fseek(0,SEEK_SET);
|
fp->fseek(0,SEEK_SET);
|
||||||
|
|
||||||
if(magic==0x088b1f) {
|
if(magic==0x088b1f) {
|
||||||
|
|
Loading…
Reference in New Issue