diff --git a/modules/libjar/nsZipArchive.cpp b/modules/libjar/nsZipArchive.cpp
--- a/modules/libjar/nsZipArchive.cpp
+++ b/modules/libjar/nsZipArchive.cpp
@@ -836,18 +836,20 @@ const uint8_t* nsZipArchive::GetData(nsZ
 {
   PR_ASSERT (aItem);
 MOZ_WIN_MEM_TRY_BEGIN
   uint32_t offset = GetDataOffset(aItem);
 
   // -- check if there is enough source data in the file
   if (!offset ||
       mFd->mLen < aItem->Size() ||
-      offset > mFd->mLen - aItem->Size())
+      offset > mFd->mLen - aItem->Size() ||
+      aItem->Compression() == STORED && aItem->Size() != aItem->RealSize()) {
     return nullptr;
+  }
 
   return mFd->mFileData + offset;
 MOZ_WIN_MEM_TRY_CATCH(return nullptr)
 }
 
 // nsZipArchive::GetComment
 bool nsZipArchive::GetComment(nsACString &aComment)
 {
