Skip to content

Commit

Permalink
raw: tweak seek implementation
Browse files Browse the repository at this point in the history
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
  • Loading branch information
tsdgeos committed Dec 14, 2022
1 parent f4ca3f6 commit 05bd939
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/imageformats/raw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class LibRaw_QIODevice : public LibRaw_abstract_datastream
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;
Expand Down

0 comments on commit 05bd939

Please sign in to comment.