Skip to content

Commit cf68f21

Browse files
committed
Fix infinite loop in image parser with zero sized files
1 parent 7b2557e commit cf68f21

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

PIFShellExtensionsLib/PIFParser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ HRESULT CBaseImageParser::ReadLineFromStream(
356356
while (SUCCEEDED(hr) && IsWhitespace(chCurrent))
357357
{
358358
hr = IStream_Read(pStream, (void*)&chCurrent, sizeof(char));
359-
if (IsWhitespace(chCurrent))
359+
if (SUCCEEDED(hr) && IsWhitespace(chCurrent))
360360
{
361361
// If we found leading white space chars we need to update
362362
// our origin.

0 commit comments

Comments
 (0)