Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8094220

javafx.scene.image.Image() constructor may hangs on corrupted image

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 8
    • Fix Version/s: 8u60
    • Component/s: javafx
    • Labels:
    • Environment:

      Win 7, b66

      Description

      javafx.scene.image.Image() constructor hangs (infinite loop?) on some corrupted images

      Sample code (image is attached):

      import java.io.FileInputStream;
      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.image.Image;
      import javafx.scene.image.ImageView;
      import javafx.scene.layout.HBox;
      import javafx.stage.Stage;

      public class Main extends Application {
          public static void main(String[] args) {
              launch();
          }
          @Override
          public void start(Stage stage) throws Exception {
              FileInputStream input_byte_stream = new FileInputStream("corrupted_image.png");
              Image image = new Image(input_byte_stream);
              HBox pane = new HBox();
              ImageView view = new ImageView(image);
              pane.getChildren().add(view);
              Scene scene = new Scene(pane, 1024, 1024);
              stage.setScene(scene);
              stage.show();
          }
      }

        Attachments

          Activity

            People

            • Assignee:
              vadim Vadim Pakhnushev
              Reporter:
              ogb Oleg Barbashov (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: