safety fix for unusual small ROMs.

This commit is contained in:
Thomas Jentzsch 2019-04-01 16:03:14 +02:00
parent 8c8128934c
commit ff65426954
1 changed files with 14 additions and 13 deletions

View File

@ -85,6 +85,7 @@ string ControllerDetector::autodetectPort(const uInt8* image, uInt32 size,
bool ControllerDetector::searchForBytes(const uInt8* image, uInt32 imagesize,
const uInt8* signature, uInt32 sigsize)
{
if (imagesize >= sigsize)
for(uInt32 i = 0; i < imagesize - sigsize; ++i)
{
uInt32 matches = 0;