From 05bd9397b31685a9e885161afc016da3fbc78cf6 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Wed, 14 Dec 2022 23:56:20 +0100 Subject: [PATCH] raw: tweak seek implementation libraw uses fseek when doing files, which allows seeking past the end without problems, so do the same, otherwise when we report oss-fuzz issues they say "give me an example to reproduce" and since our seek and their seek don't behave the same it's hard to convince them to fix their code --- src/imageformats/raw.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/imageformats/raw.cpp b/src/imageformats/raw.cpp index 63d817a..00a3257 100644 --- a/src/imageformats/raw.cpp +++ b/src/imageformats/raw.cpp @@ -141,7 +141,7 @@ public: if (whence == SEEK_END) { pos = size + o; } - if (pos < 0 || pos > size || m_device->isSequential()) { + if (pos < 0 || m_device->isSequential()) { return -1; } return m_device->seek(pos) ? 0 : -1;