Fix issue 414: Incomplete loading of some GIF images

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1747 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud 2011-03-05 17:29:28 +00:00
parent d403d134f3
commit 504f25f1e1

View File

@ -2195,14 +2195,18 @@ void Load_GIF(T_IO_Context * context)
} }
} }
else else
{
File_error=2; File_error=2;
break;
}
} // Code End-Of-Information ou erreur de fichier rencontré } // Code End-Of-Information ou erreur de fichier rencontré
if (File_error==2 && GIF_pos_X==0 && GIF_pos_Y==IDB.Image_height)
File_error=0;
/*Close_lecture();*/ /*Close_lecture();*/
if (File_error>=0) if (File_error>=0)
if ( /* (GIF_pos_X!=0) || */ if ( /* (GIF_pos_X!=0) || */
( ( (!GIF_interlaced) && (GIF_pos_Y!=IDB.Image_height) ) || ( ( (!GIF_interlaced) && (GIF_pos_Y!=IDB.Image_height) && (GIF_pos_X!=0)) ||
( (GIF_interlaced) && (!GIF_finished_interlaced_image) ) ( (GIF_interlaced) && (!GIF_finished_interlaced_image) )
) ) ) )
File_error=2; File_error=2;
@ -2214,7 +2218,8 @@ void Load_GIF(T_IO_Context * context)
break; break;
} }
// Lecture du code de fonction suivant: // Lecture du code de fonction suivant:
Read_byte(GIF_file,&block_identifier); if (!Read_byte(GIF_file,&block_identifier))
File_error=2;
} }
} // Le fichier contenait un LSDB } // Le fichier contenait un LSDB
else else