提交 05c0d6d6 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Use only one length check in ValueGeometry.getGeometryNoCopy()

上级 89b73af1
...@@ -155,7 +155,7 @@ public class ValueGeometry extends Value { ...@@ -155,7 +155,7 @@ public class ValueGeometry extends Value {
if (geometry == null) { if (geometry == null) {
try { try {
int srid = 0; int srid = 0;
getSRID: if (bytes.length >= 5) { getSRID: if (bytes.length >= 9) {
boolean bigEndian; boolean bigEndian;
switch (bytes[0]) { switch (bytes[0]) {
case 0: case 0:
...@@ -167,7 +167,7 @@ public class ValueGeometry extends Value { ...@@ -167,7 +167,7 @@ public class ValueGeometry extends Value {
default: default:
break getSRID; break getSRID;
} }
if ((bytes[bigEndian ? 1 : 4] & 0x20) != 0 && bytes.length >= 9) { if ((bytes[bigEndian ? 1 : 4] & 0x20) != 0) {
srid = Bits.readInt(bytes, 5); srid = Bits.readInt(bytes, 5);
if (!bigEndian) { if (!bigEndian) {
srid = Integer.reverseBytes(srid); srid = Integer.reverseBytes(srid);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论