Skip to content

Commit 6997797

Browse files
committed
PDFBOX-5861: avoid ClassCastException
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1919643 13f79535-47bb-0310-9956-ffa450edef68
1 parent 2a0b6e8 commit 6997797

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/state/SetLineCapStyle.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ public void process(Operator operator, List<COSBase> arguments) throws IOExcepti
4545
{
4646
throw new MissingOperandException(operator, arguments);
4747
}
48+
if (!checkArrayTypesClass(arguments, COSNumber.class))
49+
{
50+
return;
51+
}
4852
int lineCapStyle = ((COSNumber)arguments.get( 0 )).intValue();
4953
getContext().getGraphicsState().setLineCap(lineCapStyle);
5054
}

pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/state/SetLineJoinStyle.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ public void process(Operator operator, List<COSBase> arguments) throws IOExcepti
4747
{
4848
throw new MissingOperandException(operator, arguments);
4949
}
50+
if (!checkArrayTypesClass(arguments, COSNumber.class))
51+
{
52+
return;
53+
}
5054
int lineJoinStyle = ((COSNumber)arguments.get( 0 )).intValue();
5155
getContext().getGraphicsState().setLineJoin(lineJoinStyle);
5256
}

pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/state/SetLineMiterLimit.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ public void process(Operator operator, List<COSBase> arguments) throws IOExcepti
4646
{
4747
throw new MissingOperandException(operator, arguments);
4848
}
49+
if (!checkArrayTypesClass(arguments, COSNumber.class))
50+
{
51+
return;
52+
}
4953
COSNumber miterLimit = (COSNumber)arguments.get( 0 );
5054
getContext().getGraphicsState().setMiterLimit(miterLimit.floatValue());
5155
}

pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/state/SetLineWidth.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ public void process(Operator operator, List<COSBase> arguments) throws IOExcepti
4747
{
4848
throw new MissingOperandException(operator, arguments);
4949
}
50+
if (!checkArrayTypesClass(arguments, COSNumber.class))
51+
{
52+
return;
53+
}
5054
COSNumber width = (COSNumber) arguments.get(0);
5155
getContext().getGraphicsState().setLineWidth(width.floatValue());
5256
}

0 commit comments

Comments
 (0)