提交 f040bfbc 编写于 作者: B bae

7014528: ColorModel and SampleModel gotten from the same ImageTypeSpecifier...

7014528: ColorModel and SampleModel gotten from the same ImageTypeSpecifier instance can be not compatible
Reviewed-by: jgodinez, prr
上级 e33e8684
......@@ -343,8 +343,13 @@ public abstract class PackedColorModel extends ColorModel {
if (bitMasks.length != maskArray.length) {
return false;
}
/* compare 'effective' masks only, i.e. only part of the mask
* which fits the capacity of the transfer type.
*/
int maxMask = (int)((1L << DataBuffer.getDataTypeSize(transferType)) - 1);
for (int i=0; i < bitMasks.length; i++) {
if (bitMasks[i] != maskArray[i]) {
if ((maxMask & bitMasks[i]) != (maxMask & maskArray[i])) {
return false;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册