mirror of
https://github.com/opencv/opencv.git
synced 2025-07-25 22:57:53 +08:00
Merge pull request #8645 from brian-armstrong-discord:bugfix_inmemory_exif
This commit is contained in:
commit
a7e80f7c10
@ -70,21 +70,21 @@ protected:
|
|||||||
std::ios_base::seekdir dir,
|
std::ios_base::seekdir dir,
|
||||||
std::ios_base::openmode )
|
std::ios_base::openmode )
|
||||||
{
|
{
|
||||||
// get absolute offset
|
char* whence = eback();
|
||||||
off_type off = offset;
|
|
||||||
if (dir == std::ios_base::cur)
|
if (dir == std::ios_base::cur)
|
||||||
{
|
{
|
||||||
off += gptr() - eback();
|
whence = gptr();
|
||||||
}
|
}
|
||||||
else if (dir == std::ios_base::end)
|
else if (dir == std::ios_base::end)
|
||||||
{
|
{
|
||||||
off += egptr() - eback();
|
whence = egptr();
|
||||||
}
|
}
|
||||||
|
char* to = whence + offset;
|
||||||
|
|
||||||
// check limits
|
// check limits
|
||||||
if (off >= (off_type)0 && off <= egptr() - eback())
|
if (to >= eback() && to <= egptr())
|
||||||
{
|
{
|
||||||
setg(eback(), gptr() + off, egptr());
|
setg(eback(), to, egptr());
|
||||||
return gptr() - eback();
|
return gptr() - eback();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user