Skip to content

Commit

Permalink
PDFBOX-5861: avoid ClassCastException
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1919643 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
THausherr committed Aug 2, 2024
1 parent 2a0b6e8 commit 6997797
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ public void process(Operator operator, List<COSBase> arguments) throws IOExcepti
{
throw new MissingOperandException(operator, arguments);
}
if (!checkArrayTypesClass(arguments, COSNumber.class))
{
return;
}
int lineCapStyle = ((COSNumber)arguments.get( 0 )).intValue();
getContext().getGraphicsState().setLineCap(lineCapStyle);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ public void process(Operator operator, List<COSBase> arguments) throws IOExcepti
{
throw new MissingOperandException(operator, arguments);
}
if (!checkArrayTypesClass(arguments, COSNumber.class))
{
return;
}
int lineJoinStyle = ((COSNumber)arguments.get( 0 )).intValue();
getContext().getGraphicsState().setLineJoin(lineJoinStyle);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ public void process(Operator operator, List<COSBase> arguments) throws IOExcepti
{
throw new MissingOperandException(operator, arguments);
}
if (!checkArrayTypesClass(arguments, COSNumber.class))
{
return;
}
COSNumber miterLimit = (COSNumber)arguments.get( 0 );
getContext().getGraphicsState().setMiterLimit(miterLimit.floatValue());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ public void process(Operator operator, List<COSBase> arguments) throws IOExcepti
{
throw new MissingOperandException(operator, arguments);
}
if (!checkArrayTypesClass(arguments, COSNumber.class))
{
return;
}
COSNumber width = (COSNumber) arguments.get(0);
getContext().getGraphicsState().setLineWidth(width.floatValue());
}
Expand Down

0 comments on commit 6997797

Please sign in to comment.