You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2026/05/14 15:41:42 UTC

(pdfbox-jbig2) branch master updated (0a1f3d0 -> ed95af7)

This is an automated email from the ASF dual-hosted git repository.

asf-gitbox-commits pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/pdfbox-jbig2.git


    from 0a1f3d0  PDFBOX-6151: skip tests if file isn't available (e.g. when doing "mvn clean")
     new b63ca93  PDFBOX-5660: refactor to avoid label usage
     new ed95af7  PDFBOX-5660: Sonar fix

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../java/org/apache/pdfbox/jbig2/decoder/mmr/MMRDecompressor.java | 8 ++++++--
 src/main/java/org/apache/pdfbox/jbig2/image/BitmapScanline.java   | 4 ++--
 2 files changed, 8 insertions(+), 4 deletions(-)


(pdfbox-jbig2) 02/02: PDFBOX-5660: Sonar fix

Posted by ti...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

asf-gitbox-commits pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pdfbox-jbig2.git

commit ed95af7f6474cca76c1602964f718ee6c2fd4632
Author: Tilman Hausherr <ti...@apache.org>
AuthorDate: Thu May 14 17:41:31 2026 +0200

    PDFBOX-5660: Sonar fix
---
 src/main/java/org/apache/pdfbox/jbig2/image/BitmapScanline.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/pdfbox/jbig2/image/BitmapScanline.java b/src/main/java/org/apache/pdfbox/jbig2/image/BitmapScanline.java
index f748d5e..e8b68f3 100644
--- a/src/main/java/org/apache/pdfbox/jbig2/image/BitmapScanline.java
+++ b/src/main/java/org/apache/pdfbox/jbig2/image/BitmapScanline.java
@@ -84,9 +84,9 @@ final class BitmapScanline extends Scanline
 
                 int sum = start;
                 for (int weightIndex = 0, srcIndex = weightTab.i0; weightIndex < weights
-                        && srcIndex < srcBuffer.length; weightIndex++)
+                        && srcIndex < srcBuffer.length; weightIndex++, srcIndex++)
                 {
-                    sum += weightTab.weights[weightIndex] * (srcBuffer[srcIndex++] >> preShift0);
+                    sum += weightTab.weights[weightIndex] * (srcBuffer[srcIndex] >> preShift0);
                 }
 
                 final int t = sum >> postShift0;


(pdfbox-jbig2) 01/02: PDFBOX-5660: refactor to avoid label usage

Posted by ti...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

asf-gitbox-commits pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pdfbox-jbig2.git

commit b63ca93951a292137308d99642b312613a36942e
Author: Tilman Hausherr <ti...@apache.org>
AuthorDate: Thu May 14 17:26:30 2026 +0200

    PDFBOX-5660: refactor to avoid label usage
---
 .../java/org/apache/pdfbox/jbig2/decoder/mmr/MMRDecompressor.java | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/pdfbox/jbig2/decoder/mmr/MMRDecompressor.java b/src/main/java/org/apache/pdfbox/jbig2/decoder/mmr/MMRDecompressor.java
index e781985..0ac83e6 100644
--- a/src/main/java/org/apache/pdfbox/jbig2/decoder/mmr/MMRDecompressor.java
+++ b/src/main/java/org/apache/pdfbox/jbig2/decoder/mmr/MMRDecompressor.java
@@ -612,7 +612,7 @@ public class MMRDecompressor
         Code code = null;
         int refOffset = 0;
 
-        loop: while (iBitPos < width)
+        while (iBitPos < width)
         {
             while (true)
             {
@@ -629,7 +629,7 @@ public class MMRDecompressor
 
                 if (code.runLength < 0)
                 {
-                    break loop;
+                    break;
                 }
 
                 iBitPos += code.runLength;
@@ -641,6 +641,10 @@ public class MMRDecompressor
                     break;
                 }
             }
+            if (code.runLength < 0)
+            {
+                break;
+            }
         }
 
         if (runOffsets[refOffset] != width)