Fix potential null read for truncated dex files

In the case where a dex file is truncated, don't attempt to read the
header.

Added regression test.

Bug: 63756964
Bug: 72826975
Test: mm test-art-host-gtest-dex2oat_test -j64
Test: mm test-art-target-gtest-dex2oat_test -j64
Change-Id: I9bd6bb445ef2eb1c961044f43ac71f04ef8c04a5
3 files changed