Load_IFF() fix overflow in ColorCycling parsing CRNG
This commit is contained in:
parent
a90170f3d1
commit
fcb0502d2b
@ -932,6 +932,12 @@ void Load_IFF(T_IO_Context * context)
|
||||
if (max_col<min_col)
|
||||
SWAP_BYTES(min_col,max_col)
|
||||
|
||||
if (context->Color_cycles >= 16)
|
||||
{
|
||||
Warning("Maximum CRNG number is 16");
|
||||
}
|
||||
else
|
||||
{
|
||||
context->Cycle_range[context->Color_cycles].Start=min_col;
|
||||
context->Cycle_range[context->Color_cycles].End=max_col;
|
||||
context->Cycle_range[context->Color_cycles].Inverse=(flags&2)?1:0;
|
||||
@ -940,6 +946,7 @@ void Load_IFF(T_IO_Context * context)
|
||||
context->Color_cycles++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
File_error=47;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user