mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
UPSTREAM: cbfs-compression-tool: catch compression failures
If compression failed, just store the uncompressed data, which is what
cbfstool does as well.
BUG=chrome-os-partner:62235
BRANCH=none
TEST=none
Change-Id: I41f911169f376be3dab1335d93e1b3ff68ad7377
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: b46c4ecaba
Original-Change-Id: I67f51982b332d6ec1bea7c9ba179024fc5344743
Original-Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Reviewed-on: https://review.coreboot.org/18201
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Original-Reviewed-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://chromium-review.googlesource.com/430741
This commit is contained in:
parent
2fda02021c
commit
484e33c460
1 changed files with 6 additions and 1 deletions
|
@ -150,7 +150,12 @@ int compress(char *infile, char *outfile, char *algoname)
|
|||
remsize -= readsz;
|
||||
}
|
||||
|
||||
comp(indata, insize, outdata, &outsize);
|
||||
if (comp(indata, insize, outdata, &outsize) == -1) {
|
||||
outsize = insize;
|
||||
free(outdata);
|
||||
outdata = indata;
|
||||
algo = &types_cbfs_compression[0];
|
||||
}
|
||||
|
||||
char header[8];
|
||||
header[0] = algo->type & 0xff;
|
||||
|
|
Loading…
Add table
Reference in a new issue