src/file_pdf.c: check ftell returned value for error code

This commit is contained in:
Christophe Grenier 2013-11-01 12:15:12 +01:00
parent b26e8bc161
commit a87dd6095c

View file

@ -92,6 +92,11 @@ static void file_rename_pdf(const char *old_filename)
return; return;
} }
offset=ftell(handle); offset=ftell(handle);
if(offset < 0)
{
fclose(handle);
return;
}
offset=file_rsearch(handle, offset, pattern, sizeof(pattern)); offset=file_rsearch(handle, offset, pattern, sizeof(pattern));
if(offset==0) if(offset==0)
{ {