You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "gwlucastrig (via GitHub)" <gi...@apache.org> on 2023/11/17 14:47:34 UTC

[PR] [Imaging-369] Fix array bounds exception for TIFF with internal JPEG … [commons-imaging]

gwlucastrig opened a new pull request, #335:
URL: https://github.com/apache/commons-imaging/pull/335

   This pull request addresses an error introduced by Imaging-194 in which an edge-case could cause an array-bounds exception when reading an odd-sized TIFF file with internal JPEG compression (TIFF with JPEG is a new feature contributed by Imaging-194).
   
   The pull request includes a code fix, expanded JUnit test, and a new test file.  It fixes the problem and slightly improves the JUnit test coverage. Code passed spotbugs and checkstyle checks.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Imaging-369] Fix array bounds exception for TIFF with internal JPEG … [commons-imaging]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #335:
URL: https://github.com/apache/commons-imaging/pull/335#issuecomment-1817336860

   ## [Codecov](https://app.codecov.io/gh/apache/commons-imaging/pull/335?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   All modified and coverable lines are covered by tests :white_check_mark:
   > Comparison is base [(`50e3dc5`)](https://app.codecov.io/gh/apache/commons-imaging/commit/50e3dc5a6a2b802de5c061afd493616a81bcfb68?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) 71.26% compared to head [(`d7ba95b`)](https://app.codecov.io/gh/apache/commons-imaging/pull/335?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) 71.28%.
   > Report is 2 commits behind head on master.
   
   
   <details><summary>Additional details and impacted files</summary>
   
   
   ```diff
   @@             Coverage Diff              @@
   ##             master     #335      +/-   ##
   ============================================
   + Coverage     71.26%   71.28%   +0.02%     
   - Complexity     3541     3543       +2     
   ============================================
     Files           352      352              
     Lines         17360    17360              
     Branches       2690     2690              
   ============================================
   + Hits          12371    12375       +4     
   + Misses         3926     3924       -2     
   + Partials       1063     1061       -2     
   ```
   
   
   
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/commons-imaging/pull/335?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Imaging-369] Fix array bounds exception for TIFF with internal JPEG … [commons-imaging]

Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on code in PR #335:
URL: https://github.com/apache/commons-imaging/pull/335#discussion_r1398044328


##########
src/test/java/org/apache/commons/imaging/formats/tiff/TiffJpegTest.java:
##########
@@ -51,6 +51,11 @@ public class TiffJpegTest extends TiffBaseTest {
         "TestSampleArgb.tiff",
         "TestJpegArgb.tiff",};
 
+      static final String[] testSet3 = {
+        "TestSampleRgb127x127.tiff",
+        "TestJpegRgb127x127.tiff",};

Review Comment:
   Remove trailing comma.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Imaging-369] Fix array bounds exception for TIFF with internal JPEG … [commons-imaging]

Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on code in PR #335:
URL: https://github.com/apache/commons-imaging/pull/335#discussion_r1398044269


##########
src/test/java/org/apache/commons/imaging/formats/tiff/TiffJpegTest.java:
##########
@@ -161,6 +166,11 @@ public void testFullPixelMatch() throws IOException {
 
         // test set 2 includes a TIFF-specific alpha channel
         processTestSet(testSet2);
+
+        // test set 3 includes an add-valued width and height that does
+        // not evently fit a block of JPEG data. It is used to test
+        // for the proper handling of edge-cases.
+         processTestSet(testSet3);

Review Comment:
   oops, looks an extra space.



##########
src/test/java/org/apache/commons/imaging/formats/tiff/TiffJpegTest.java:
##########
@@ -161,6 +166,11 @@ public void testFullPixelMatch() throws IOException {
 
         // test set 2 includes a TIFF-specific alpha channel
         processTestSet(testSet2);
+
+        // test set 3 includes an add-valued width and height that does
+        // not evently fit a block of JPEG data. It is used to test
+        // for the proper handling of edge-cases.
+         processTestSet(testSet3);

Review Comment:
   oops, looks like an extra space.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Imaging-369] Fix array bounds exception for TIFF with internal JPEG … [commons-imaging]

Posted by "gwlucastrig (via GitHub)" <gi...@apache.org>.
gwlucastrig commented on code in PR #335:
URL: https://github.com/apache/commons-imaging/pull/335#discussion_r1398239328


##########
src/test/java/org/apache/commons/imaging/formats/tiff/TiffJpegTest.java:
##########
@@ -161,6 +166,11 @@ public void testFullPixelMatch() throws IOException {
 
         // test set 2 includes a TIFF-specific alpha channel
         processTestSet(testSet2);
+
+        // test set 3 includes an add-valued width and height that does
+        // not evently fit a block of JPEG data. It is used to test
+        // for the proper handling of edge-cases.
+         processTestSet(testSet3);

Review Comment:
   done



##########
src/test/java/org/apache/commons/imaging/formats/tiff/TiffJpegTest.java:
##########
@@ -51,6 +51,11 @@ public class TiffJpegTest extends TiffBaseTest {
         "TestSampleArgb.tiff",
         "TestJpegArgb.tiff",};
 
+      static final String[] testSet3 = {
+        "TestSampleRgb127x127.tiff",
+        "TestJpegRgb127x127.tiff",};

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Imaging-369] Fix array bounds exception for TIFF with internal JPEG … [commons-imaging]

Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory merged PR #335:
URL: https://github.com/apache/commons-imaging/pull/335


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org