Skip to content

Commit 1c3f5c4

Browse files
Merge from master
2 parents 58c978f + 5f7ffee commit 1c3f5c4

File tree

6 files changed

+91
-37
lines changed

6 files changed

+91
-37
lines changed

modules/javafx.media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-bad/gst/aiff/aiffparse.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1343,6 +1343,14 @@ gst_aiff_parse_stream_data (GstAiffParse * aiff)
13431343
if (desired >= aiff->bytes_per_sample)
13441344
desired -= (desired % aiff->bytes_per_sample);
13451345

1346+
#ifdef GSTREAMER_LITE
1347+
if (desired == 0) {
1348+
GST_ELEMENT_ERROR (aiff, STREAM, DEMUX, (NULL),
1349+
("Invalid stream"));
1350+
return GST_FLOW_ERROR;
1351+
}
1352+
#endif // GSTREAMER_LITE
1353+
13461354
GST_LOG_OBJECT (aiff, "Fetching %" G_GINT64_FORMAT " bytes of data "
13471355
"from the sinkpad", desired);
13481356

modules/javafx.media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-good/gst/wavparse/gstwavparse.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2064,6 +2064,14 @@ gst_wavparse_stream_data (GstWavParse * wav)
20642064
if (desired >= wav->blockalign && wav->blockalign > 0)
20652065
desired -= (desired % wav->blockalign);
20662066

2067+
#ifdef GSTREAMER_LITE
2068+
if (desired == 0) {
2069+
GST_ELEMENT_ERROR (wav, STREAM, DEMUX, (NULL),
2070+
("Invalid stream"));
2071+
return GST_FLOW_ERROR;
2072+
}
2073+
#endif // GSTREAMER_LITE
2074+
20672075
GST_LOG_OBJECT (wav, "Fetching %" G_GINT64_FORMAT " bytes of data "
20682076
"from the sinkpad", desired);
20692077

modules/javafx.web/src/main/java/com/sun/javafx/webkit/theme/RenderThemeImpl.java

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -313,26 +313,29 @@ protected Ref createWidget(
313313
if (ctrl.isManaged()) {
314314
ctrl.setManaged(false);
315315
}
316-
if (type == WidgetType.SLIDER) {
317-
Slider slider = (Slider)ctrl;
318-
extParams.order(ByteOrder.nativeOrder());
319-
slider.setOrientation(extParams.getInt()==0
320-
? Orientation.HORIZONTAL
321-
: Orientation.VERTICAL);
322-
slider.setMax(extParams.getFloat());
323-
slider.setMin(extParams.getFloat());
324-
slider.setValue(extParams.getFloat());
325-
} else if (type == WidgetType.PROGRESSBAR) {
326-
ProgressBar progress = (ProgressBar)ctrl;
327-
extParams.order(ByteOrder.nativeOrder());
328-
progress.setProgress(extParams.getInt() == 1
329-
? extParams.getFloat()
330-
: progress.INDETERMINATE_PROGRESS);
331-
} else if (type == WidgetType.METER) {
332-
ProgressBar progress = (ProgressBar) ctrl;
333-
extParams.order(ByteOrder.nativeOrder());
334-
progress.setProgress(extParams.getFloat());
335-
progress.setStyle(getMeterStyle(extParams.getInt()));
316+
317+
if (extParams != null) {
318+
if (type == WidgetType.SLIDER) {
319+
Slider slider = (Slider)ctrl;
320+
extParams.order(ByteOrder.nativeOrder());
321+
slider.setOrientation(extParams.getInt()==0
322+
? Orientation.HORIZONTAL
323+
: Orientation.VERTICAL);
324+
slider.setMax(extParams.getFloat());
325+
slider.setMin(extParams.getFloat());
326+
slider.setValue(extParams.getFloat());
327+
} else if (type == WidgetType.PROGRESSBAR) {
328+
ProgressBar progress = (ProgressBar)ctrl;
329+
extParams.order(ByteOrder.nativeOrder());
330+
progress.setProgress(extParams.getInt() == 1
331+
? extParams.getFloat()
332+
: progress.INDETERMINATE_PROGRESS);
333+
} else if (type == WidgetType.METER) {
334+
ProgressBar progress = (ProgressBar) ctrl;
335+
extParams.order(ByteOrder.nativeOrder());
336+
progress.setProgress(extParams.getFloat());
337+
progress.setStyle(getMeterStyle(extParams.getInt()));
338+
}
336339
}
337340
return new FormControlRef(fc);
338341
}

modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/java/ImageBufferJava.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ Vector<uint8_t> ImageBuffer::toData(const String& mimeType, std::optional<double
491491
static jmethodID midToData = env->GetMethodID(
492492
PG_GetImageClass(env),
493493
"toData",
494-
"(Ljava/lang/String;)Ljava/lang/String;");
494+
"(Ljava/lang/String;)[B");
495495
ASSERT(midToData);
496496

497497
JLocalRef<jbyteArray> jdata((jbyteArray)env->CallObjectMethod(

modules/javafx.web/src/main/native/Source/WebCore/platform/java/RenderThemeJava.cpp

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ bool RenderThemeJava::paintWidget(
177177
JNIEnv* env = WebCore_GetJavaEnv();
178178

179179
WTF::Vector<jbyte> extParams;
180-
if (JNI_EXPAND(SLIDER) == widgetIndex) {
180+
if (JNI_EXPAND(SLIDER) == widgetIndex && is<RenderSlider>(object)) {
181181
HTMLInputElement& input = downcast<RenderSlider>(object).element();
182182

183183
extParams.grow(sizeof(jint) + 3 * sizeof(jfloat));
@@ -200,24 +200,26 @@ bool RenderThemeJava::paintWidget(
200200
memcpy(data, &valueAsNumber, sizeof(valueAsNumber));
201201
} else if (JNI_EXPAND(PROGRESS_BAR) == widgetIndex) {
202202
#if ENABLE(PROGRESS_ELEMENT)
203-
RenderProgress& renderProgress = downcast<RenderProgress>(object);
203+
if (is<RenderProgress>(object)) {
204+
RenderProgress& renderProgress = downcast<RenderProgress>(object);
204205

205-
extParams.grow(sizeof(jint) + 3*sizeof(jfloat));
206-
jbyte *data = extParams.data();
207-
auto isDeterminate = jint(renderProgress.isDeterminate() ? 1 : 0);
208-
memcpy(data, &isDeterminate, sizeof(isDeterminate));
209-
data += sizeof(jint);
206+
extParams.grow(sizeof(jint) + 3*sizeof(jfloat));
207+
jbyte *data = extParams.data();
208+
auto isDeterminate = jint(renderProgress.isDeterminate() ? 1 : 0);
209+
memcpy(data, &isDeterminate, sizeof(isDeterminate));
210+
data += sizeof(jint);
210211

211-
auto position = jfloat(renderProgress.position());
212-
memcpy(data, &position, sizeof(position));
213-
data += sizeof(jfloat);
212+
auto position = jfloat(renderProgress.position());
213+
memcpy(data, &position, sizeof(position));
214+
data += sizeof(jfloat);
214215

215-
auto animationProgress = jfloat(renderProgress.animationProgress());
216-
memcpy(data, &animationProgress, sizeof(animationProgress));
217-
data += sizeof(jfloat);
216+
auto animationProgress = jfloat(renderProgress.animationProgress());
217+
memcpy(data, &animationProgress, sizeof(animationProgress));
218+
data += sizeof(jfloat);
218219

219-
auto animationStartTime = jfloat(renderProgress.animationStartTime());
220-
memcpy(data, &animationStartTime, sizeof(animationStartTime));
220+
auto animationStartTime = jfloat(renderProgress.animationStartTime());
221+
memcpy(data, &animationStartTime, sizeof(animationStartTime));
222+
}
221223
#endif
222224
#if ENABLE(METER_ELEMENT)
223225
} else if (JNI_EXPAND(METER) == widgetIndex) {
@@ -228,7 +230,7 @@ bool RenderThemeJava::paintWidget(
228230
value = meter->valueRatio();
229231
region = meter->gaugeRegion();
230232
#if ENABLE(PROGRESS_ELEMENT)
231-
} else if (object.isProgress()) {
233+
} else if (is<RenderProgress>(object>)) {
232234
RenderProgress& renderProgress = downcast<RenderProgress>(object);
233235
value = jfloat(renderProgress.position());
234236
#endif
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* This code is free software; you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License version 2 only, as
7+
* published by the Free Software Foundation. Oracle designates this
8+
* particular file as subject to the "Classpath" exception as provided
9+
* by Oracle in the LICENSE file that accompanied this code.
10+
*
11+
* This code is distributed in the hope that it will be useful, but WITHOUT
12+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+
* version 2 for more details (a copy is included in the LICENSE file that
15+
* accompanied this code).
16+
*
17+
* You should have received a copy of the GNU General Public License version
18+
* 2 along with this work; if not, write to the Free Software Foundation,
19+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+
*
21+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+
* or visit www.oracle.com if you need additional information or have any
23+
* questions.
24+
*/
25+
26+
package com.sun.javafx.webkit.prism;
27+
28+
public final class PrismInvokerShim {
29+
public static void runOnRenderThread(final Runnable r) {
30+
PrismInvoker.runOnRenderThread(r);
31+
}
32+
}
33+

0 commit comments

Comments
 (0)