Sanity checking for frame and texuture hints from filenames.
This commit is contained in:
@@ -26,8 +26,15 @@ static void GetResolutionFromFileName( RString sPath, int &iWidth, int &iHeight
|
||||
if( !re.Compare(sPath, asMatches) )
|
||||
return;
|
||||
|
||||
iWidth = StringToInt( asMatches[0] );
|
||||
iHeight = StringToInt( asMatches[1] );
|
||||
// Check for nonsense values. Some people might not intend the hint. -Kyz
|
||||
int maybe_width= StringToInt(asMatches[0]);
|
||||
int maybe_height= StringToInt(asMatches[1]);
|
||||
if(maybe_width <= 0 || maybe_height <= 0 || maybe_width > iWidth || maybe_height > iHeight)
|
||||
{
|
||||
return;
|
||||
}
|
||||
iWidth = maybe_width;
|
||||
iHeight = maybe_height;
|
||||
}
|
||||
|
||||
RageBitmapTexture::RageBitmapTexture( RageTextureID name ) :
|
||||
|
||||
Reference in New Issue
Block a user