summaryrefslogtreecommitdiff
path: root/core/fxge/win32/fx_win32_gdipext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxge/win32/fx_win32_gdipext.cpp')
-rw-r--r--core/fxge/win32/fx_win32_gdipext.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/fxge/win32/fx_win32_gdipext.cpp b/core/fxge/win32/fx_win32_gdipext.cpp
index 64c8ea7408..a83a4496fe 100644
--- a/core/fxge/win32/fx_win32_gdipext.cpp
+++ b/core/fxge/win32/fx_win32_gdipext.cpp
@@ -952,6 +952,8 @@ class GpStream final : public IStream {
start = m_ReadPos;
break;
case STREAM_SEEK_END:
+ if (m_InterStream.tellp() < 0)
+ return STG_E_SEEKERROR;
start = m_InterStream.tellp();
break;
default:
@@ -973,6 +975,10 @@ class GpStream final : public IStream {
return STG_E_INVALIDFUNCTION;
ZeroMemory(pStatstg, sizeof(STATSTG));
+
+ if (m_InterStream.tellp() < 0)
+ return STG_E_SEEKERROR;
+
pStatstg->cbSize.QuadPart = m_InterStream.tellp();
return S_OK;
}