From 86656a9d52ac2ccb03cab66ad8e93851374165e5 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sun, 15 May 2011 10:48:59 +0000 Subject: [PATCH] Replaced some large local variables by other means in libburn/async.c --- cdrskin/cdrskin_timestamp.h | 2 +- libburn/async.c | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/cdrskin/cdrskin_timestamp.h b/cdrskin/cdrskin_timestamp.h index 8f99fd3..dfb094e 100644 --- a/cdrskin/cdrskin_timestamp.h +++ b/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2011.05.15.104727" +#define Cdrskin_timestamP "2011.05.15.104926" diff --git a/libburn/async.c b/libburn/async.c index 40f8003..fd6d0a5 100644 --- a/libburn/async.c +++ b/libburn/async.c @@ -445,7 +445,7 @@ void burn_disc_format(struct burn_drive *drive, off_t size, int flag) { struct format_opts o; int ok = 0, ret; - char msg[160]; + char msg[40]; reset_progress(drive, 1, 1, 1, 0x10000, 0); @@ -586,7 +586,7 @@ static void *write_disc_worker_func(struct w_list *w) void burn_disc_write(struct burn_write_opts *opts, struct burn_disc *disc) { struct write_opts o; - char reasons[BURN_REASONS_LEN+80]; + char *reasons= NULL; struct burn_drive *d; d = opts->drive; @@ -646,6 +646,8 @@ void burn_disc_write(struct burn_write_opts *opts, struct burn_disc *disc) /* ts A70219 : intended to replace all further tests here and many tests in burn_*_write_sync() */ + + BURN_ALLOC_MEM(reasons, char, BURN_REASONS_LEN + 80); strcpy(reasons, "Write job parameters are unsuitable:\n"); if (burn_precheck_write(opts, disc, reasons + strlen(reasons), 1) <= 0) { @@ -653,8 +655,9 @@ void burn_disc_write(struct burn_write_opts *opts, struct burn_disc *disc) d->global_index, 0x00020139, LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH, reasons, 0, 0); - return; + goto ex; } + BURN_FREE_MEM(reasons); reasons= NULL; /* ts A90106 : early catching of unformatted BD-RE */ if (d->current_profile == 0x43) @@ -678,6 +681,9 @@ void burn_disc_write(struct burn_write_opts *opts, struct burn_disc *disc) add_worker(Burnworker_type_writE, d, (WorkerFunc) write_disc_worker_func, &o); + +ex:; + BURN_FREE_MEM(reasons); }