diff --git a/buffer/src/main/java/io/netty/buffer/UnsafeByteBufUtil.java b/buffer/src/main/java/io/netty/buffer/UnsafeByteBufUtil.java index c8b18d1e96..fe2d1dd285 100644 --- a/buffer/src/main/java/io/netty/buffer/UnsafeByteBufUtil.java +++ b/buffer/src/main/java/io/netty/buffer/UnsafeByteBufUtil.java @@ -152,7 +152,8 @@ final class UnsafeByteBufUtil { short v = PlatformDependent.getShort(array, index); return BIG_ENDIAN_NATIVE_ORDER ? v : Short.reverseBytes(v); } - return (short) (PlatformDependent.getByte(index) << 8 | PlatformDependent.getByte(index + 1) & 0xff); + return (short) (PlatformDependent.getByte(array, index) << 8 | + PlatformDependent.getByte(array, index + 1) & 0xff); } static int getUnsignedMedium(byte[] array, int index) {