diff options
-rw-r--r-- | poppler/Stream.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/poppler/Stream.h b/poppler/Stream.h index 245f0ab7..5d9ad0c9 100644 --- a/poppler/Stream.h +++ b/poppler/Stream.h @@ -694,7 +694,10 @@ private: { int n; - if (nChars <= 0) { + if (unlikely(nChars <= 0)) { + return 0; + } + if (unlikely(bufPtr >= bufEnd)) { return 0; } if (bufEnd - bufPtr < nChars) { |