Merge "Exit loop earlier for bsdiff's pathological case" am: d3f0369732

Original change: https://android-review.googlesource.com/c/platform/external/bsdiff/+/2627658

Change-Id: I94ba5bacb5bdf763cc31816aad957680e9ef7435
Signed-off-by: Automerger Merge Worker <[email protected]>
This commit is contained in:
Treehugger Robot authored and Automerger Merge Worker committed 2023-06-15 23:00:37 +00:00
commit 6fd01a93b5
2 files changed
+2 -5

No files matched your search

+1 -1
View File
@@ -119,7 +119,7 @@ int bsdiff(const uint8_t* old_buf, size_t oldsize, const uint8_t* new_buf,
oldscore++;
if(((len==oldscore) && (len!=0)) ||
(len>oldscore+8 && len>=min_length)) break;
(len>=oldscore+8 && len>=min_length)) break;
if((scan+lastoffset<oldsize) &&
(old_buf[scan+lastoffset] == new_buf[scan]))
+1 -4
View File
@@ -13,10 +13,6 @@
#include "bsdiff/control_entry.h"
#include "bsdiff/logging.h"
namespace {
} // namespace
namespace bsdiff {
@@ -43,6 +39,7 @@ bool BsdiffPatchWriter::InitializeCompressorList(
LOG(ERROR) << "Patch writer expects at least one compressor.";
return false;
}
compressor_list->clear();
for (const auto& type : types_) {
switch (type) {