8170798: Fix minor issues in java2d and sound coding.
authorgoetz
Tue, 06 Dec 2016 14:54:11 +0100
changeset 42938 c0b3077af726
parent 42937 3acb5995b491
child 42939 e5d5f0f2d40d
8170798: Fix minor issues in java2d and sound coding. Reviewed-by: prr, serb
jdk/src/java.desktop/share/native/libfontmanager/layout/ScriptAndLanguageTags.cpp
jdk/src/java.desktop/share/native/libfontmanager/layout/ThaiShaping.cpp
jdk/src/java.desktop/share/native/libfontmanager/layout/ThaiShaping.h
jdk/src/java.desktop/share/native/libfontmanager/layout/ThaiStateTables.cpp
jdk/src/java.desktop/unix/native/libjsound/PLATFORM_API_BsdOS_ALSA_Ports.c
jdk/src/java.desktop/unix/native/libjsound/PLATFORM_API_LinuxOS_ALSA_Ports.c
jdk/src/java.desktop/unix/native/libjsound/PLATFORM_API_SolarisOS_Ports.c
--- a/jdk/src/java.desktop/share/native/libfontmanager/layout/ScriptAndLanguageTags.cpp	Fri Dec 16 16:09:52 2016 -0800
+++ b/jdk/src/java.desktop/share/native/libfontmanager/layout/ScriptAndLanguageTags.cpp	Tue Dec 06 14:54:11 2016 +0100
@@ -33,13 +33,14 @@
  * Generated on: 10/26/2010 02:53:33 PM PDT
  */
 
+#include "LEScripts.h"
 #include "LETypes.h"
 #include "ScriptAndLanguageTags.h"
 #include "OpenTypeLayoutEngine.h"
 
 U_NAMESPACE_BEGIN
 
-const LETag OpenTypeLayoutEngine::scriptTags[] = {
+const LETag OpenTypeLayoutEngine::scriptTags[scriptCodeCount] = {
     zyyyScriptTag, /* 'zyyy' (COMMON) */
     zinhScriptTag, /* 'zinh' (INHERITED) */
     arabScriptTag, /* 'arab' (ARABIC) */
--- a/jdk/src/java.desktop/share/native/libfontmanager/layout/ThaiShaping.cpp	Fri Dec 16 16:09:52 2016 -0800
+++ b/jdk/src/java.desktop/share/native/libfontmanager/layout/ThaiShaping.cpp	Tue Dec 06 14:54:11 2016 +0100
@@ -302,7 +302,7 @@
         le_uint8 charClass;
 
         // Decompose SARA AM into NIKHAHIT + SARA AA
-        if (ch == CH_SARA_AM && isLegalHere(ch, state)) {
+        if (ch == CH_SARA_AM && isLegalHere(ch, state) && conState < stateCount) {
             outputIndex = conOutput;
             state = getNextState(CH_NIKHAHIT, conState, inputIndex, glyphSet, errorChar, charClass,
                 output, glyphStorage, outputIndex);
--- a/jdk/src/java.desktop/share/native/libfontmanager/layout/ThaiShaping.h	Fri Dec 16 16:09:52 2016 -0800
+++ b/jdk/src/java.desktop/share/native/libfontmanager/layout/ThaiShaping.h	Tue Dec 06 14:54:11 2016 +0100
@@ -80,7 +80,8 @@
         tG  =  5,
         tH  =  6,
         tR  =  7,
-        tS  =  8
+        tS  =  8,
+        stateCount = 52
     };
 
     struct StateTransition
@@ -100,7 +101,7 @@
     ThaiShaping();
 
     static const le_uint8 classTable[];
-    static const StateTransition thaiStateTable[][classCount];
+    static const StateTransition thaiStateTable[stateCount][classCount];
 
     inline static StateTransition getTransition(le_uint8 state, le_uint8 currClass);
 
--- a/jdk/src/java.desktop/share/native/libfontmanager/layout/ThaiStateTables.cpp	Fri Dec 16 16:09:52 2016 -0800
+++ b/jdk/src/java.desktop/share/native/libfontmanager/layout/ThaiStateTables.cpp	Tue Dec 06 14:54:11 2016 +0100
@@ -49,7 +49,7 @@
     /*0E50*/ NON, NON, NON, NON, NON, NON, NON, NON, NON, NON, NON, NON
 };
 
-const ThaiShaping::StateTransition ThaiShaping::thaiStateTable[][ThaiShaping::classCount] = {
+const ThaiShaping::StateTransition ThaiShaping::thaiStateTable[ThaiShaping::stateCount][ThaiShaping::classCount] = {
     //+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
     //|         N         C         C         C         L         F         F         F         B         B         B         T         A         A         A         N         A         A         A    |
     //|         O         O         O         O         V         V         V         V         V         V         D         O         D         D         D         I         V         V         V    |
--- a/jdk/src/java.desktop/unix/native/libjsound/PLATFORM_API_BsdOS_ALSA_Ports.c	Fri Dec 16 16:09:52 2016 -0800
+++ b/jdk/src/java.desktop/unix/native/libjsound/PLATFORM_API_BsdOS_ALSA_Ports.c	Tue Dec 06 14:54:11 2016 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, 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
@@ -385,6 +385,7 @@
     int isStereo;
     char* type;
     snd_mixer_selem_channel_id_t channel;
+    memset(controls, 0, sizeof(controls));
 
     TRACE0("> PORT_GetControls\n");
     if (id == NULL) {
--- a/jdk/src/java.desktop/unix/native/libjsound/PLATFORM_API_LinuxOS_ALSA_Ports.c	Fri Dec 16 16:09:52 2016 -0800
+++ b/jdk/src/java.desktop/unix/native/libjsound/PLATFORM_API_LinuxOS_ALSA_Ports.c	Tue Dec 06 14:54:11 2016 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, 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
@@ -385,6 +385,7 @@
     int isStereo;
     char* type;
     snd_mixer_selem_channel_id_t channel;
+    memset(controls, 0, sizeof(controls));
 
     TRACE0("> PORT_GetControls\n");
     if (id == NULL) {
--- a/jdk/src/java.desktop/unix/native/libjsound/PLATFORM_API_SolarisOS_Ports.c	Fri Dec 16 16:09:52 2016 -0800
+++ b/jdk/src/java.desktop/unix/native/libjsound/PLATFORM_API_SolarisOS_Ports.c	Tue Dec 06 14:54:11 2016 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2016, 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
@@ -390,6 +390,7 @@
     int controlCount = 0;
     INT32 type;
     int selectable = 1;
+    memset(controls, 0, sizeof(controls));
 
     TRACE4(">PORT_GetControls(id=%p, portIndex=%d). controlIDs=%p, maxControlCount=%d\n",
            id, portIndex, info->controlIDs, info->maxControlCount);