changeset 10573:9f9f6610066b

Merge
author kcr
date Fri, 26 May 2017 10:17:37 -0700
parents 51d33b49c088 916c637f5ff1
children 1979dc6ca95a
files
diffstat 6 files changed, 90 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/modules/javafx.base/src/main/java/javafx/beans/property/BooleanProperty.java	Thu May 25 19:03:30 2017 -0700
+++ b/modules/javafx.base/src/main/java/javafx/beans/property/BooleanProperty.java	Fri May 26 10:17:37 2017 -0700
@@ -31,6 +31,10 @@
 import javafx.beans.value.WritableBooleanValue;
 import com.sun.javafx.binding.Logging;
 
+import java.security.AccessControlContext;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
 /**
  * This class provides a full implementation of a {@link Property} wrapping a
  * {@code boolean} value.
@@ -137,6 +141,7 @@
             throw new NullPointerException("Property cannot be null");
         }
         return property instanceof BooleanProperty ? (BooleanProperty)property : new BooleanPropertyBase() {
+            private final AccessControlContext acc = AccessController.getContext();
             {
                 BidirectionalBinding.bind(this, property);
             }
@@ -154,7 +159,10 @@
             @Override
             protected void finalize() throws Throwable {
                 try {
-                    BidirectionalBinding.unbind(property, this);
+                    AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
+                        BidirectionalBinding.unbind(property, this);
+                        return null;
+                    }, acc);
                 } finally {
                     super.finalize();
                 }
@@ -174,7 +182,7 @@
     @Override
     public ObjectProperty<Boolean> asObject() {
         return new ObjectPropertyBase<Boolean> () {
-
+            private final AccessControlContext acc = AccessController.getContext();
             {
                 BidirectionalBinding.bind(this, BooleanProperty.this);
             }
@@ -192,7 +200,10 @@
             @Override
             protected void finalize() throws Throwable {
                 try {
-                    BidirectionalBinding.unbind(this, BooleanProperty.this);
+                    AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
+                        BidirectionalBinding.unbind(this, BooleanProperty.this);
+                        return null;
+                    }, acc);
                 } finally {
                     super.finalize();
                 }
--- a/modules/javafx.base/src/main/java/javafx/beans/property/DoubleProperty.java	Thu May 25 19:03:30 2017 -0700
+++ b/modules/javafx.base/src/main/java/javafx/beans/property/DoubleProperty.java	Fri May 26 10:17:37 2017 -0700
@@ -37,6 +37,10 @@
 import javafx.beans.value.ChangeListener;
 import javafx.beans.value.ObservableDoubleValue;
 
+import java.security.AccessControlContext;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
 /**
  * This class defines a {@link Property} wrapping a {@code double} value.
  * <p>
@@ -152,6 +156,7 @@
             throw new NullPointerException("Property cannot be null");
         }
         return new DoublePropertyBase() {
+            private final AccessControlContext acc = AccessController.getContext();
             {
                 BidirectionalBinding.bindNumber(this, property);
             }
@@ -169,7 +174,10 @@
             @Override
             protected void finalize() throws Throwable {
                 try {
-                    BidirectionalBinding.unbindNumber(property, this);
+                    AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
+                        BidirectionalBinding.unbindNumber(property, this);
+                        return null;
+                    }, acc);
                 } finally {
                     super.finalize();
                 }
@@ -199,7 +207,7 @@
     @Override
     public ObjectProperty<Double> asObject() {
         return new ObjectPropertyBase<Double> () {
-
+            private final AccessControlContext acc = AccessController.getContext();
             {
                 BidirectionalBinding.bindNumber(this, DoubleProperty.this);
             }
@@ -217,7 +225,10 @@
             @Override
             protected void finalize() throws Throwable {
                 try {
-                    BidirectionalBinding.unbindNumber(this, DoubleProperty.this);
+                    AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
+                        BidirectionalBinding.unbindNumber(this, DoubleProperty.this);
+                        return null;
+                    }, acc);
                 } finally {
                     super.finalize();
                 }
--- a/modules/javafx.base/src/main/java/javafx/beans/property/FloatProperty.java	Thu May 25 19:03:30 2017 -0700
+++ b/modules/javafx.base/src/main/java/javafx/beans/property/FloatProperty.java	Fri May 26 10:17:37 2017 -0700
@@ -31,6 +31,10 @@
 import javafx.beans.value.WritableFloatValue;
 import com.sun.javafx.binding.Logging;
 
+import java.security.AccessControlContext;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
 /**
  * This class defines a {@link Property} wrapping a {@code float} value.
  * <p>
@@ -147,6 +151,7 @@
             throw new NullPointerException("Property cannot be null");
         }
         return new FloatPropertyBase() {
+            private final AccessControlContext acc = AccessController.getContext();
             {
                 BidirectionalBinding.bindNumber(this, property);
             }
@@ -164,7 +169,10 @@
             @Override
             protected void finalize() throws Throwable {
                 try {
-                    BidirectionalBinding.unbindNumber(property, this);
+                    AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
+                        BidirectionalBinding.unbindNumber(property, this);
+                        return null;
+                    }, acc);
                 } finally {
                     super.finalize();
                 }
@@ -194,7 +202,7 @@
     @Override
     public ObjectProperty<Float> asObject() {
         return new ObjectPropertyBase<Float> () {
-
+            private final AccessControlContext acc = AccessController.getContext();
             {
                 BidirectionalBinding.bindNumber(this, FloatProperty.this);
             }
@@ -212,7 +220,10 @@
             @Override
             protected void finalize() throws Throwable {
                 try {
-                    BidirectionalBinding.unbindNumber(this, FloatProperty.this);
+                    AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
+                        BidirectionalBinding.unbindNumber(this, FloatProperty.this);
+                        return null;
+                    }, acc);
                 } finally {
                     super.finalize();
                 }
--- a/modules/javafx.base/src/main/java/javafx/beans/property/IntegerProperty.java	Thu May 25 19:03:30 2017 -0700
+++ b/modules/javafx.base/src/main/java/javafx/beans/property/IntegerProperty.java	Fri May 26 10:17:37 2017 -0700
@@ -31,6 +31,10 @@
 import javafx.beans.value.WritableIntegerValue;
 import com.sun.javafx.binding.Logging;
 
+import java.security.AccessControlContext;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
 /**
  * This class defines a {@link Property} wrapping an {@code int} value.
  * <p>
@@ -147,6 +151,7 @@
             throw new NullPointerException("Property cannot be null");
         }
         return new IntegerPropertyBase() {
+            private final AccessControlContext acc = AccessController.getContext();
             {
                 BidirectionalBinding.bindNumber(this, property);
             }
@@ -164,7 +169,10 @@
             @Override
             protected void finalize() throws Throwable {
                 try {
-                    BidirectionalBinding.unbindNumber(property, this);
+                    AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
+                        BidirectionalBinding.unbindNumber(property, this);
+                        return null;
+                    }, acc);
                 } finally {
                     super.finalize();
                 }
@@ -194,7 +202,7 @@
     @Override
     public ObjectProperty<Integer> asObject() {
         return new ObjectPropertyBase<Integer> () {
-
+            private final AccessControlContext acc = AccessController.getContext();
             {
                 BidirectionalBinding.bindNumber(this, IntegerProperty.this);
             }
@@ -212,7 +220,10 @@
             @Override
             protected void finalize() throws Throwable {
                 try {
-                    BidirectionalBinding.unbindNumber(this, IntegerProperty.this);
+                    AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
+                        BidirectionalBinding.unbindNumber(this, IntegerProperty.this);
+                        return null;
+                    }, acc);
                 } finally {
                     super.finalize();
                 }
--- a/modules/javafx.base/src/main/java/javafx/beans/property/LongProperty.java	Thu May 25 19:03:30 2017 -0700
+++ b/modules/javafx.base/src/main/java/javafx/beans/property/LongProperty.java	Fri May 26 10:17:37 2017 -0700
@@ -31,6 +31,10 @@
 import javafx.beans.value.WritableLongValue;
 import com.sun.javafx.binding.Logging;
 
+import java.security.AccessControlContext;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
 /**
  * This class defines a {@link Property} wrapping a {@code long} value.
  * <p>
@@ -145,6 +149,7 @@
             throw new NullPointerException("Property cannot be null");
         }
         return new LongPropertyBase() {
+            private final AccessControlContext acc = AccessController.getContext();
             {
                 BidirectionalBinding.bindNumber(this, property);
             }
@@ -162,7 +167,10 @@
             @Override
             protected void finalize() throws Throwable {
                 try {
-                    BidirectionalBinding.unbindNumber(property, this);
+                    AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
+                        BidirectionalBinding.unbindNumber(property, this);
+                        return null;
+                    }, acc);
                 } finally {
                     super.finalize();
                 }
@@ -192,7 +200,7 @@
     @Override
     public ObjectProperty<Long> asObject() {
         return new ObjectPropertyBase<Long> () {
-
+            private final AccessControlContext acc = AccessController.getContext();
             {
                 BidirectionalBinding.bindNumber(this, LongProperty.this);
             }
@@ -210,7 +218,10 @@
             @Override
             protected void finalize() throws Throwable {
                 try {
-                    BidirectionalBinding.unbindNumber(this, LongProperty.this);
+                    AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
+                        BidirectionalBinding.unbindNumber(this, LongProperty.this);
+                        return null;
+                    }, acc);
                 } finally {
                     super.finalize();
                 }
--- a/modules/javafx.media/src/main/native/gstreamer/plugins/vp6/flvparser.c	Thu May 25 19:03:30 2017 -0700
+++ b/modules/javafx.media/src/main/native/gstreamer/plugins/vp6/flvparser.c	Fri May 26 10:17:37 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2017, 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
@@ -263,6 +263,15 @@
     audio_tag->audio_packet_size = parser->next_block_size
             - FLV_TAG_SUFFIX_SIZE - audio_tag->audio_packet_offset;
 
+    // Make sure packet_offset and size are correct.
+    if (audio_tag->audio_packet_offset > buffer_size)
+        return FLV_PARSER_BUFFER_UNDERRUN;
+
+    if (audio_tag->audio_packet_size <= 0)
+        return FLV_PARSER_BUFFER_UNDERRUN;
+
+    if ((buffer_size - audio_tag->audio_packet_offset) < audio_tag->audio_packet_size)
+        return FLV_PARSER_BUFFER_UNDERRUN;
 
     /* Update parser and return */
     parser->parsed_block_size = parser->next_block_size;
@@ -292,6 +301,16 @@
     video_tag->video_packet_size = parser->next_block_size
             - FLV_TAG_SUFFIX_SIZE - video_tag->video_packet_offset;
 
+    // Make sure packet_offset and size are correct.
+    if (video_tag->video_packet_offset > buffer_size)
+        return FLV_PARSER_BUFFER_UNDERRUN;
+
+    if (video_tag->video_packet_size <= 0)
+        return FLV_PARSER_BUFFER_UNDERRUN;
+
+    if ((buffer_size - video_tag->video_packet_offset) < video_tag->video_packet_size)
+        return FLV_PARSER_BUFFER_UNDERRUN;
+
     /* Update parser and return */
     parser->parsed_block_size = parser->next_block_size;
     parser->file_position += parser->parsed_block_size;