Revert a bug from c1f4b7c where CRAM aux tags were not compressed. #1729
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In an attempt to fix memory leaks during encode of malformed CRAM data, that lead to bailing out early, we attempted to get everything to a uniform state as soon as possible. Specifically s->aux_blocks get migrated to s->blocks earlier, so if we bail out we don't have the decision to make as to which bit of memory needs freeing.
That worked, but unfortunately I forgot that the compression is applied to s->aux_blocks and not s->blocks for auxiliary tags, so moving the blocks earlier gives uncompressed blocks in CRAM. The format is valid and all tests pass, but it's overly large for obvious reasons.
Sadly this is a rather serious bug caused by an attempt to fix a really minor bug.
Fixes samtools/samtools#1968