[OpenJDK 2D-Dev] RFR(M): 8170798: Fix minor issues in java2d and sound coding.

Lindenmaier, Goetz goetz.lindenmaier at sap.com
Fri Dec 9 07:57:54 UTC 2016


Hi,


This change fixes some minor issues found in our code scans.

I hope this correctly addresses corelib and serviceability issues.



Please review:

http://cr.openjdk.java.net/~goetz/wr16/8170798-java2d_sound/webrev.01/



Best regards,

  Goetz.



Changes in detail:



hg-ot-font.cc

Looks like assignment instead of compare. Use extra if().


hg-ot_layout-gpos-table.hh

valueFormat is passed to apply(), where it is used as an array with two elements:
line 621: valueFormats[1].get_len();
It was correct as there are actually two fields in the struct that have the
same layout as an array.


ScriptAndLanguageTags.cpp, ThaiShaping.cpp/.h


In ThaiShaping.cpp:307 conState is passed to getNextState() where it is in the end used to index to thaiStateTable.
thaiStateTable has 52 elements. But conState is initialized to 0xFF == 255 in ThaiShaping.cpp:296. This can result in an out-of-bounds access.

OpenTypeLayoutEngine::scriptTags[scriptCodeCount] is accessed with index < scriptCodeCount, but only contains scriptCodeCount-1 elements.

I added a size entry to the enums, and use that for sizing the array and checking the size.


jctrans.c

if cinfo->entropy->encode_mcu resolves to encode_mcu_AC_first() it will access MCU_buffer[0]. (jcphuff.c:487)



cmserr.c

Must check return value of ftell.


cmsgamma.c

Out/out/in are used as arrays in called function.


cmslut.c

Out[] may be used uninitialized.


cmstypes.c

Must check return value of Tell. The negative outcome should not be passed to Seek.


cmsxform.c

Using uninitialized element of array wIn when calling *p->FromInput. (The function pointer resolves to Pack1Byte.)
Using uninitialized element of array fIn when calling *p->FromInputFloat. (The function pointer resolves to PackDoublesFromFloat.)
Using uninitialized element of array fIn when calling *p->FromInputFloat. (The function pointer resolves to PackDoublesFromFloat.)


PLATFORM_API_LinuxOS_ALSA_Ports.c

Using uninitialized element of array controls when calling *creator->newCompoundControl. (The function pointer resolves to PORT_NewCompoundControl.)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/2d-dev/attachments/20161209/542f29b4/attachment.html>


More information about the 2d-dev mailing list