From 04a0b7e8fcc0685eb9574a6a9f02178aecec64ec Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Tue, 24 Oct 2006 16:53:53 +0000 Subject: [PATCH] Closed some loopholes for byte swapping --- cdrskin/cdrskin_timestamp.h | 2 +- libburn/sector.c | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/cdrskin/cdrskin_timestamp.h b/cdrskin/cdrskin_timestamp.h index fe027b6..7beef7f 100644 --- a/cdrskin/cdrskin_timestamp.h +++ b/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2006.10.24.130259" +#define Cdrskin_timestamP "2006.10.24.165427" diff --git a/libburn/sector.c b/libburn/sector.c index 5fed2c5..43d2415 100644 --- a/libburn/sector.c +++ b/libburn/sector.c @@ -99,7 +99,7 @@ static void get_bytes(struct burn_track *track, int count, unsigned char *data) shortage = count - valid; if (!shortage) - return; + goto ex; /* Next we use source data */ curr = valid; @@ -116,7 +116,7 @@ static void get_bytes(struct burn_track *track, int count, unsigned char *data) shortage = count - curr; if (!shortage) - return; + goto ex; /* Before going to the next track, we run through any tail */ @@ -132,7 +132,7 @@ static void get_bytes(struct burn_track *track, int count, unsigned char *data) shortage -= valid; if (!shortage) - return; + goto ex; /* If we're still short, and there's a "next" pointer, we pull from that. if that depletes, we'll just fill with 0s. @@ -152,6 +152,15 @@ ex:; if(shortage) memset(data + curr, 0, shortage); /* this is old icculus.org */ if (track->swap_source_bytes == 1) { + +/* +{ static int swapping_count= 0; + fprintf(stderr,"\rlibburn_debug: swapping #%d \r", + swapping_count); + swapping_count++; +} +*/ + for (i = 1; i < count; i += 2) { tr = data[i]; data[i] = data[i-1];