cbfstool: have decompress functions provide ouput data size
Currently cbfs stage files that are compressed do not have the decompressed size readily available. Therefore there's no good way to know actual size of data after it is decompressed. Optionally return the decompressed data size if requested. Change-Id: If371753d28d0ff512118d8bc06fdd48f4a0aeae7 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/12173 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
committed by
Patrick Georgi
parent
cd9ba8ac03
commit
5213c53f6f
@@ -692,7 +692,7 @@ int cbfs_export_entry(struct cbfs_image *image, const char *entry_name,
|
||||
buffer.data = malloc(decompressed_size);
|
||||
buffer.size = decompressed_size;
|
||||
if (decompress(CBFS_SUBHEADER(entry), ntohl(entry->len),
|
||||
buffer.data, buffer.size)) {
|
||||
buffer.data, buffer.size, NULL)) {
|
||||
ERROR("decompression failed for %s\n", entry_name);
|
||||
return -1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user