Fix bug in InMemoryDexClassLoader loading

InMemoryDexClassLoader can load dex files from both direct and indirect
ByteBuffers but it only respects the buffer's current position for the
latter and assumes the position is zero for the former.

Bug: 123337866
Test: art/tools/run-libcore-tests.sh

Change-Id: Id294814c68f7e9e859d67c12fe1f62e52e84c45e
diff --git a/runtime/native/dalvik_system_DexFile.cc b/runtime/native/dalvik_system_DexFile.cc
index daf02fe..4f9cf70 100644
--- a/runtime/native/dalvik_system_DexFile.cc
+++ b/runtime/native/dalvik_system_DexFile.cc
@@ -244,7 +244,7 @@
   }
 
   size_t length = static_cast<size_t>(end - start);
-  memcpy(dex_mem_map.Begin(), base_address, length);
+  memcpy(dex_mem_map.Begin(), base_address + start, length);
   return CreateSingleDexFileCookie(env, std::move(dex_mem_map));
 }