From a26ba9522e0e543d84c25e22421367e79ffe02e9 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Wed, 10 Dec 2025 08:44:59 +0000 Subject: [PATCH] Fixes subchannel block wrong size initialization. --- src/close.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/close.c b/src/close.c index 1db6f4c..53e05df 100644 --- a/src/close.c +++ b/src/close.c @@ -1558,14 +1558,13 @@ static void write_sector_subchannel(const aaruformat_context *ctx) bool owns_buffer = false; uint8_t lzma_properties[LZMA_PROPERTIES_LENGTH] = {0}; - subchannel_block.cmpLength = subchannel_block.length; - if(ctx->image_info.MetadataMediaType == OpticalDisc) { subchannel_block.type = CdSectorSubchannel; subchannel_block.length = (uint32_t)(ctx->user_data_ddt_header.negative + ctx->image_info.Sectors + ctx->user_data_ddt_header.overflow) * 96; + subchannel_block.cmpLength = subchannel_block.length; if(ctx->compression_enabled) { @@ -1632,6 +1631,7 @@ static void write_sector_subchannel(const aaruformat_context *ctx) TRACE("Incorrect media type, not writing sector subchannel block"); return; // Incorrect media type } + subchannel_block.cmpLength = subchannel_block.length; subchannel_block.compression = Lzma; uint8_t *dst_buffer = malloc(subchannel_block.length);