ZSTD read from wrong buf

Fix zstd to read from ignore_buf rather than buf since that is where we
are first copying the date

Test: zstd ota
Change-Id: I5032300e4628ecd7e49f1fa9f76dc9a828fb58e6
This commit is contained in:
Daniel Zheng 2023-08-15 13:32:48 -07:00
parent 21aab6cb83
commit 36882e98b4

View file

@ -351,7 +351,7 @@ class ZstdDecompressor final : public IDecompressor {
return decompressed_size;
}
std::vector<unsigned char> ignore_buf(decompressed_size);
if (!Decompress(buffer, decompressed_size)) {
if (!Decompress(ignore_buf.data(), decompressed_size)) {
return -1;
}
memcpy(buffer, ignore_buf.data() + ignore_bytes, buffer_size);