mirror of
https://github.com/UglyToad/PdfPig.git
synced 2026-03-10 00:23:29 +08:00
avoid infinite loop in #291, logic issue is still present for png predictor
This commit is contained in:
@@ -55,6 +55,13 @@
|
|||||||
int offset = 0;
|
int offset = 0;
|
||||||
while (offset < rowlength && ((i = input.Read(actline, offset, rowlength - offset)) != -1))
|
while (offset < rowlength && ((i = input.Read(actline, offset, rowlength - offset)) != -1))
|
||||||
{
|
{
|
||||||
|
if (i == 0)
|
||||||
|
{
|
||||||
|
// TODO: #291, this indicates a bug in reading logic.
|
||||||
|
// This only avoids the infinite loop it does not fix the logic bug.
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
offset += i;
|
offset += i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user