Merge "fastboot: Check if super_empty.img exists before reading it." am: dbbbb17c1d am: d8e8f71a20
am: 3e389f2894

Change-Id: Ie853f7acda50974c9854d92d1abfc1417ef179cd
diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp
index fee0857..b717aef 100644
--- a/fastboot/fastboot.cpp
+++ b/fastboot/fastboot.cpp
@@ -1541,7 +1541,7 @@
         return false;
     }
     auto path = find_item_given_name("super_empty.img");
-    if (path.empty()) {
+    if (path.empty() || access(path.c_str(), R_OK)) {
         return false;
     }
     auto metadata = android::fs_mgr::ReadFromImageFile(path);