We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fe21487 commit 40dc0bcCopy full SHA for 40dc0bc
modules/imgcodecs/src/loadsave.cpp
@@ -70,21 +70,21 @@ class ByteStreamBuffer: public std::streambuf
70
std::ios_base::seekdir dir,
71
std::ios_base::openmode )
72
{
73
- // get absolute offset
74
- off_type off = offset;
+ char* whence = eback();
75
if (dir == std::ios_base::cur)
76
77
- off += gptr() - eback();
+ whence = gptr();
78
}
79
else if (dir == std::ios_base::end)
80
81
- off += egptr() - eback();
+ whence = egptr();
82
+ char* to = whence + offset;
83
84
// check limits
85
- if (off >= (off_type)0 && off <= egptr() - eback())
+ if (to >= eback() && to <= egptr())
86
87
- setg(eback(), gptr() + off, egptr());
+ setg(eback(), to, egptr());
88
return gptr() - eback();
89
90
0 commit comments