mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 19:24:08 +00:00
parent
49c6ae7032
commit
0c7d7ada21
|
@ -131,7 +131,7 @@ void Babylon::close()
|
||||||
|
|
||||||
bool Babylon::readBlock( bgl_block &block )
|
bool Babylon::readBlock( bgl_block &block )
|
||||||
{
|
{
|
||||||
if( gzeof( file ) || file == NULL )
|
if ( file == NULL || gzeof( file ) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
block.length = bgl_readnum( 1 );
|
block.length = bgl_readnum( 1 );
|
||||||
|
@ -346,8 +346,10 @@ bgl_entry Babylon::readEntry( ResourceHandler * resourceHandler )
|
||||||
{
|
{
|
||||||
switch( block.type )
|
switch( block.type )
|
||||||
{
|
{
|
||||||
case 2:
|
case 2: {
|
||||||
{
|
// the block data may have length==0
|
||||||
|
if ( block.length == 0 )
|
||||||
|
break;
|
||||||
pos = 0;
|
pos = 0;
|
||||||
len = (unsigned char)block.data[ pos++ ];
|
len = (unsigned char)block.data[ pos++ ];
|
||||||
if ( pos + len > block.length )
|
if ( pos + len > block.length )
|
||||||
|
@ -356,9 +358,7 @@ bgl_entry Babylon::readEntry( ResourceHandler * resourceHandler )
|
||||||
//if (filename != "8EAF66FD.bmp" && filename != "C2EEF3F6.html") {
|
//if (filename != "8EAF66FD.bmp" && filename != "C2EEF3F6.html") {
|
||||||
pos += len;
|
pos += len;
|
||||||
if ( resourceHandler )
|
if ( resourceHandler )
|
||||||
resourceHandler->handleBabylonResource( filename,
|
resourceHandler->handleBabylonResource( filename, block.data + pos, block.length - pos );
|
||||||
block.data + pos,
|
|
||||||
block.length - pos );
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 1:
|
case 1:
|
||||||
|
|
Loading…
Reference in a new issue