Skip to content

Commit

Permalink
fix(flac): don't throw bad_compression error as this loses metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
mhx committed Dec 20, 2023
1 parent b61662c commit 7363006
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/dwarfs/compression/flac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,10 @@ class flac_block_compressor final : public block_compressor::impl {
DWARFS_THROW(runtime_error, "[FLAC] failed to finish encoder");
}

if (compressed.size() >= data.size()) {
throw bad_compression_ratio_error();
}
// XXX: don't throw this as we're losing metadata
// if (compressed.size() >= data.size()) {
// throw bad_compression_ratio_error();
// }

compressed.shrink_to_fit();

Expand Down

0 comments on commit 7363006

Please sign in to comment.