Add more checks in the presence of file corruption.

Bug: 243897589
Test: test.py
Change-Id: I0b9beae1259643c620fc48fcac590e03d0629674
1 file changed