You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2022/05/21 19:30:14 UTC

[commons-imaging] branch master updated: [IMAGING-335] NullPointerException in App2Segment.getIccBytes when parsing a broken JPEG file

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

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-imaging.git


The following commit(s) were added to refs/heads/master by this push:
     new 12be4daa [IMAGING-335] NullPointerException in App2Segment.getIccBytes when parsing a broken JPEG file
12be4daa is described below

commit 12be4daa3eb7eb140add818ec79ff7726c00fc50
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat May 21 15:30:10 2022 -0400

    [IMAGING-335] NullPointerException in App2Segment.getIccBytes when
    parsing a broken JPEG file
---
 pom.xml                                                           | 8 --------
 src/changes/changes.xml                                           | 3 +++
 .../apache/commons/imaging/formats/jpeg/segments/App2Segment.java | 2 +-
 3 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/pom.xml b/pom.xml
index b77d0e21..b6d8aa73 100644
--- a/pom.xml
+++ b/pom.xml
@@ -19,10 +19,6 @@
 
   <modelVersion>4.0.0</modelVersion>
 
-  <!-- ====================================================================== -->
-  <!-- P R O J E C T  D E S C R I P T I O N                                   -->
-  <!-- ====================================================================== -->
-
   <parent>
     <groupId>org.apache.commons</groupId>
     <artifactId>commons-parent</artifactId>
@@ -431,10 +427,6 @@
     </profile>
   </profiles>
 
-  <!-- ====================================================================== -->
-  <!-- P E O P L E                                                            -->
-  <!-- ====================================================================== -->
-
   <developers>
     <developer>
       <name>Charles M. Chen</name>
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index d6f2d8e5..a94b81d8 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -48,6 +48,9 @@ The <action> type attribute can be add,update,fix,remove.
       <action dev="kinow" type="update" due-to="Dependabot">
         Bump spotbugs-maven-plugin from 4.6.0.0 to 4.7.0.0 #221.
       </action>
+      <action issue="IMAGING-335" dev="ggregory" type="update" due-to="Dominik Stadler, Gary Gregory">
+        NullPointerException in App2Segment.getIccBytes when parsing a broken JPEG file.
+      </action>
     </release>
     <release version="1.0-alpha3" date="2022-05-13" description="Third 1.0 alpha release">
       <action issue="IMAGING-330" dev="kinow" type="fix" due-to="Gary Lucas">
diff --git a/src/main/java/org/apache/commons/imaging/formats/jpeg/segments/App2Segment.java b/src/main/java/org/apache/commons/imaging/formats/jpeg/segments/App2Segment.java
index fa5f2a92..c1862e18 100644
--- a/src/main/java/org/apache/commons/imaging/formats/jpeg/segments/App2Segment.java
+++ b/src/main/java/org/apache/commons/imaging/formats/jpeg/segments/App2Segment.java
@@ -87,6 +87,6 @@ public class App2Segment extends AppnSegment implements Comparable<App2Segment>
      * @return the iccBytes
      */
     public byte[] getIccBytes() {
-        return iccBytes.clone();
+        return iccBytes != null ? iccBytes.clone() : null;
     }
 }