# HG changeset patch # User mcherkas # Date 1378303969 -14400 # Node ID a1c89924203ce4adca24bc9ab0a14bfa83c49dfa # Parent 7bfa2460d74c906bfa7d7c7732e03686154c3907 8023565: JPG causes javax.imageio.IIOException: ICC APP2 encoutered without prior JFIF Reviewed-by: bae, vadim diff -r 7bfa2460d74c -r a1c89924203c jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadata.java --- a/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadata.java Wed Sep 04 14:32:13 2013 +0400 +++ b/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadata.java Wed Sep 04 18:12:49 2013 +0400 @@ -1,5 +1,5 @@ /* - * 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. * * This code is free software; you can redistribute it and/or modify it @@ -278,10 +278,11 @@ (JFIFMarkerSegment) findMarkerSegment (JFIFMarkerSegment.class, true); if (jfif == null) { - throw new IIOException - ("ICC APP2 encountered without prior JFIF!"); + newGuy = new MarkerSegment(buffer); + newGuy.loadData(buffer); + } else { + jfif.addICC(buffer); } - jfif.addICC(buffer); // newGuy remains null } else { newGuy = new MarkerSegment(buffer);