diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2024-12-08 22:36:02 +0100 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2024-12-08 22:37:12 +0100 |
commit | 019c4302ad86fd6981e8abc90cd8cb58003b662c (patch) | |
tree | d628782319eda36507fb5f5abcf6225ce9ac631a /plugins/pdf.lua | |
parent | 189bf940342ebf23b15c7f2dfd27d8a4692b34fc (diff) | |
download | hex-019c4302ad86fd6981e8abc90cd8cb58003b662c.tar.gz hex-019c4302ad86fd6981e8abc90cd8cb58003b662c.tar.xz hex-019c4302ad86fd6981e8abc90cd8cb58003b662c.zip |
Handle tiny files gracefullyHEADorigin/mastermaster
Lua detection functions used to cause fatal errors on failure to read.
We could also reconsider treating detection errors as fatal.
Diffstat (limited to 'plugins/pdf.lua')
-rw-r--r-- | plugins/pdf.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/pdf.lua b/plugins/pdf.lua index d4c7f26..9703f2d 100644 --- a/plugins/pdf.lua +++ b/plugins/pdf.lua @@ -335,7 +335,7 @@ end -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - local detect = function (c) - return c:read (5) == "%PDF-" + return #c >= 5 and c:read (5) == "%PDF-" end local decode_xref_subsection = function (lex, start, count, result) |