From c191ab4f78867c801b941d03e4a9e0c7ceee00b0 Mon Sep 17 00:00:00 2001 From: Josh Coalson Date: Mon, 23 Dec 2002 19:52:20 +0000 Subject: [PATCH] double-protect a naked assert --- src/flac/main.c | 6 +++++- src/metaflac/operations.c | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/flac/main.c b/src/flac/main.c index 2e80d1ab..0d867f17 100644 --- a/src/flac/main.c +++ b/src/flac/main.c @@ -500,8 +500,12 @@ int do_it() grabbag__replaygain_get_album(&album_gain, &album_peak); for(i = 0; i < option_values.num_files; i++) { const char *error, *outfilename = get_encoded_outfilename(option_values.filenames[i]); - if(0 == strcmp(option_values.filenames[i], "-")) + if(0 == strcmp(option_values.filenames[i], "-")) { FLAC__ASSERT(0); + /* double protection */ + fprintf(stderr, "internal error\n"); + return 2; + } if(0 != (error = grabbag__replaygain_store_to_file_album(outfilename, album_gain, album_peak, /*preserve_modtime=*/true))) { fprintf(stderr, "%s: ERROR writing ReplayGain album tags\n", outfilename); retval = 1; diff --git a/src/metaflac/operations.c b/src/metaflac/operations.c index 87ac1c73..1147be46 100644 --- a/src/metaflac/operations.c +++ b/src/metaflac/operations.c @@ -421,8 +421,12 @@ FLAC__bool do_shorthand_operation__add_replay_gain(char **filenames, unsigned nu } FLAC__ASSERT(bits_per_sample >= FLAC__MIN_BITS_PER_SAMPLE && bits_per_sample <= FLAC__MAX_BITS_PER_SAMPLE); - if(!grabbag__replaygain_init(sample_rate)) + if(!grabbag__replaygain_init(sample_rate)) { FLAC__ASSERT(0); + /* double protection */ + fprintf(stderr, "internal error\n"); + return false; + } if( 0 == (title_gains = (float*)malloc(sizeof(float) * num_files)) ||