提交 bf1e4e67 编写于 作者: M mcherkas

8023565: JPG causes javax.imageio.IIOException: ICC APP2 encoutered without prior JFIF

Reviewed-by: bae, vadim
上级 766bebff
/* /*
* Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -278,10 +278,11 @@ public class JPEGMetadata extends IIOMetadata implements Cloneable { ...@@ -278,10 +278,11 @@ public class JPEGMetadata extends IIOMetadata implements Cloneable {
(JFIFMarkerSegment) findMarkerSegment (JFIFMarkerSegment) findMarkerSegment
(JFIFMarkerSegment.class, true); (JFIFMarkerSegment.class, true);
if (jfif == null) { if (jfif == null) {
throw new IIOException newGuy = new MarkerSegment(buffer);
("ICC APP2 encountered without prior JFIF!"); newGuy.loadData(buffer);
} else {
jfif.addICC(buffer);
} }
jfif.addICC(buffer);
// newGuy remains null // newGuy remains null
} else { } else {
newGuy = new MarkerSegment(buffer); newGuy = new MarkerSegment(buffer);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册