fix: invalid data access of data field

bgl_babylon.cc

fix #770
This commit is contained in:
YiFang Xiao 2023-06-03 09:36:18 +08:00 committed by xiaoyifang
parent 0c7d7ada21
commit 1391a8fa7e

View file

@ -382,9 +382,10 @@ bgl_entry Babylon::readEntry( ResourceHandler * resourceHandler )
len = qFromBigEndian( *reinterpret_cast< quint32 * >( block.data + pos ) ); len = qFromBigEndian( *reinterpret_cast< quint32 * >( block.data + pos ) );
pos += 4; pos += 4;
} }
else else {
{ if ( pos + 1 > block.length )
len = (unsigned char)block.data[pos++]; break;
len = (unsigned char)block.data[ pos++ ];
} }
if( pos + len > block.length ) if( pos + len > block.length )