Skip to content

Commit d1de954

Browse files
authored
fix(rla): immediate fix for PR #5153 error (#5172)
Caught in review, but I didn't see the comment before I merged. --------- Signed-off-by: Larry Gritz <lg@larrygritz.com>
1 parent aae20f0 commit d1de954

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/rla.imageio/rlainput.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,9 +509,9 @@ RLAInput::decode_rle_span(span<unsigned char> buf, int n, int stride,
509509
++e;
510510
} else {
511511
// run count negative: repeat bytes literally
512-
if (count > n)
513-
break; // asking for a count that will overrun the buffer
514512
count = -count; // make it positive
513+
if (count > n)
514+
break; // asking for a count that will overrun the buffer
515515
for (; count && n > 0 && e < elen; --count, b += stride, --n)
516516
buf[b] = encoded[e++];
517517
}

0 commit comments

Comments
 (0)