[poppler] poppler/Stream.h

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Aug 26 20:47:40 UTC 2020


 poppler/Stream.h |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 55eb5c73e5fb609ba56dee28f74e53b2be28fbb7
Author: Albert Astals Cid <aacid at kde.org>
Date:   Wed Aug 26 22:37:31 2020 +0200

    BaseMemStream::getChars: If we're past the end do nothing

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) {


More information about the poppler mailing list