pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1844910 - /pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/filter/ASCIIHexFilter.java
Date Fri, 26 Oct 2018 16:18:18 GMT
Author: tilman
Date: Fri Oct 26 16:18:17 2018
New Revision: 1844910

URL: http://svn.apache.org/viewvc?rev=1844910&view=rev
Log:
PDFBOX-4360: avoid ArrayIndexOutOfBoundsException by having 256 elements

Modified:
    pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/filter/ASCIIHexFilter.java

Modified: pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/filter/ASCIIHexFilter.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/filter/ASCIIHexFilter.java?rev=1844910&r1=1844909&r2=1844910&view=diff
==============================================================================
--- pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/filter/ASCIIHexFilter.java
(original)
+++ pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/filter/ASCIIHexFilter.java
Fri Oct 26 16:18:17 2018
@@ -106,111 +106,33 @@ public class ASCIIHexFilter implements F
         result.flush();
     }
 
-    private static final int[] REVERSE_HEX =
-    {
-        -1, //0
-        -1, //1
-        -1, //2
-        -1, //3
-        -1, //4
-        -1, //5
-        -1, //6
-        -1, //7
-        -1, //8
-        -1, //9
-        -1, //10
-        -1, //11
-        -1, //12
-        -1, //13
-        -1, //14
-        -1, //15
-        -1, //16
-        -1, //17
-        -1, //18
-        -1, //19
-        -1, //20
-        -1, //21
-        -1, //22
-        -1, //23
-        -1, //24
-        -1, //25
-        -1, //26
-        -1, //27
-        -1, //28
-        -1, //29
-        -1, //30
-        -1, //31
-        -1, //32
-        -1, //33
-        -1, //34
-        -1, //35
-        -1, //36
-        -1, //37
-        -1, //38
-        -1, //39
-        -1, //40
-        -1, //41
-        -1, //42
-        -1, //43
-        -1, //44
-        -1, //45
-        -1, //46
-        -1, //47
-         0, //48
-         1, //49
-         2, //50
-         3, //51
-         4, //52
-         5, //53
-         6, //54
-         7, //55
-         8, //56
-         9, //57
-        -1, //58
-        -1, //59
-        -1, //60
-        -1, //61
-        -1, //62
-        -1, //63
-        -1, //64
-        10, //65
-        11, //66
-        12, //67
-        13, //68
-        14, //69
-        15, //70
-        -1, //71
-        -1, //72
-        -1, //73
-        -1, //74
-        -1, //75
-        -1, //76
-        -1, //77
-        -1, //78
-        -1, //79
-        -1, //80
-        -1, //81
-        -1, //82
-        -1, //83
-        -1, //84
-        -1, //85
-        -1, //86
-        -1, //87
-        -1, //88
-        -1, //89
-        -1, //90
-        -1, //91
-        -1, //92
-        -1, //93
-        -1, //94
-        -1, //95
-        -1, //96
-        10, //97
-        11, //98
-        12, //99
-        13, //100
-        14, //101
-        15, //102
+    private static final int[] REVERSE_HEX = {
+      /*   0 */  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+      /*  10 */  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+      /*  20 */  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+      /*  30 */  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+      /*  40 */  -1, -1, -1, -1, -1, -1, -1, -1,  0,  1,
+      /*  50 */   2,  3,  4,  5,  6,  7,  8,  9, -1, -1,
+      /*  60 */  -1, -1, -1, -1, -1, 10, 11, 12, 13, 14,
+      /*  70 */  15, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+      /*  80 */  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+      /*  90 */  -1, -1, -1, -1, -1, -1, -1, 10, 11, 12,
+      /* 100 */  13, 14, 15, -1, -1, -1, -1, -1, -1, -1,
+      /* 110 */  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+      /* 120 */  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+      /* 130 */  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+      /* 140 */  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+      /* 150 */  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+      /* 160 */  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+      /* 170 */  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+      /* 180 */  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+      /* 190 */  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+      /* 200 */  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+      /* 210 */  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+      /* 220 */  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+      /* 230 */  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+      /* 240 */  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+      /* 250 */  -1, -1, -1, -1, -1, -1
     };
 
     /**



Mime
View raw message