diff --git a/src/file_pdf.c b/src/file_pdf.c index 072a8802..58c6136d 100644 --- a/src/file_pdf.c +++ b/src/file_pdf.c @@ -92,6 +92,11 @@ static void file_rename_pdf(const char *old_filename) return; } offset=ftell(handle); + if(offset < 0) + { + fclose(handle); + return; + } offset=file_rsearch(handle, offset, pattern, sizeof(pattern)); if(offset==0) {