From 9593b949c293a45816b957581e6319c2a22a8a2e Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Sat, 18 Mar 2023 10:34:41 +0100 Subject: Try to unblock fuzzer_tool_flac by resetting global variables --- oss-fuzz/tool_flac.c | 3 ++- src/flac/main.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/oss-fuzz/tool_flac.c b/oss-fuzz/tool_flac.c index 3cceae6a..3f6b2b21 100644 --- a/oss-fuzz/tool_flac.c +++ b/oss-fuzz/tool_flac.c @@ -49,10 +49,11 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) int numarg = 0, maxarg, pad; int file_to_fuzz; + /* reset global vars */ flac__utils_verbosity_ = 0; share__opterr = 0; share__optind = 0; - + align_reservoir_samples = 0; if(size < 2) return 0; diff --git a/src/flac/main.c b/src/flac/main.c index 56c2dfc4..55b60a45 100644 --- a/src/flac/main.c +++ b/src/flac/main.c @@ -571,6 +571,7 @@ FLAC__bool init_options(void) { option_values.show_help = false; option_values.show_explain = false; + option_values.show_version = false; option_values.mode_decode = false; option_values.verify = false; option_values.treat_warnings_as_errors = false; -- cgit v1.2.3 From f4220895bb355d2d608704110b80f21c29e0ffa2 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Sat, 18 Mar 2023 11:49:59 +0100 Subject: Fix null dereference Credit: Oss-Fuzz Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=57032 --- src/flac/decode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/flac/decode.c b/src/flac/decode.c index c9c74546..89f6dbd8 100644 --- a/src/flac/decode.c +++ b/src/flac/decode.c @@ -707,7 +707,7 @@ FLAC__bool write_iff_headers(FILE *f, DecoderSession *decoder_session, FLAC__uin else if(format == FORMAT_AIFF) iff_size = 46 + foreign_metadata_size + aligned_data_size; else /* AIFF-C */ - iff_size = 16 + foreign_metadata_size + aligned_data_size + fm->aifc_comm_length; + iff_size = 16 + foreign_metadata_size + aligned_data_size + (fm?fm->aifc_comm_length:0); if(format != FORMAT_WAVE64 && format != FORMAT_RF64 && iff_size >= 0xFFFFFFF4) { flac__utils_printf(stderr, 1, "%s: ERROR: stream is too big to fit in a single %s file\n", decoder_session->inbasefilename, fmt_desc); -- cgit v1.2.3 From 0e1535cccee5da197f4395b6898a882ef535c7a6 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Sat, 18 Mar 2023 14:54:07 +0100 Subject: Check for invalid blocksize (65536) --- src/libFLAC/stream_decoder.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/libFLAC/stream_decoder.c b/src/libFLAC/stream_decoder.c index 34919c37..4ee53452 100644 --- a/src/libFLAC/stream_decoder.c +++ b/src/libFLAC/stream_decoder.c @@ -2496,6 +2496,14 @@ FLAC__bool read_frame_header_(FLAC__StreamDecoder *decoder) x = (x << 8) | _x; } decoder->private_->frame.header.blocksize = x+1; + if(decoder->private_->frame.header.blocksize > 65535) { /* invalid blocksize (65536) specified */ + decoder->private_->lookahead = raw_header[raw_header_len-1]; /* back up as much as we can */ + decoder->private_->cached = true; + send_error_to_client_(decoder, FLAC__STREAM_DECODER_ERROR_STATUS_BAD_HEADER); + decoder->protected_->state = FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC; + return true; + } + } if(sample_rate_hint) { -- cgit v1.2.3 From e683286bb412e0e11db2b7329c7836dcf5c5c38c Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Sat, 18 Mar 2023 19:53:00 +0100 Subject: Add use of stdin to fuzzer_tool_flac, and redirect stdout --- oss-fuzz/tool_flac.c | 37 ++++++++++++++++++++++++++++++++----- src/flac/main.c | 8 -------- 2 files changed, 32 insertions(+), 13 deletions(-) diff --git a/oss-fuzz/tool_flac.c b/oss-fuzz/tool_flac.c index 3f6b2b21..23bab345 100644 --- a/oss-fuzz/tool_flac.c +++ b/oss-fuzz/tool_flac.c @@ -46,8 +46,11 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) char * argv[67]; char exename[] = "flac"; char filename[] = "/tmp/fuzzXXXXXX"; - int numarg = 0, maxarg, pad; + int numarg = 0, maxarg; int file_to_fuzz; + int tmp_stdout, tmp_stdin; + fpos_t pos_stdout; + bool use_stdin = false; /* reset global vars */ flac__utils_verbosity_ = 0; @@ -59,7 +62,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) return 0; maxarg = data[0] & 63; - pad = data[0] & 64; + use_stdin = data[0] & 64; size_left--; argv[0] = exename; @@ -76,14 +79,38 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) if (file_to_fuzz < 0) abort(); write(file_to_fuzz,data+(size-size_left),size_left); - if(pad) - write(file_to_fuzz,"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",12); close(file_to_fuzz); - argv[numarg++] = filename; + /* redirect stdout */ + fflush(stdout); + fgetpos(stdout,&pos_stdout); + tmp_stdout = dup(fileno(stdout)); + freopen("/dev/null","w",stdout); + + /* redirect stdin */ + tmp_stdin = dup(fileno(stdin)); + + if(use_stdin) + freopen(filename,"r",stdin); + else { + freopen("/dev/null","r",stdin); + argv[numarg++] = filename; + } main_to_fuzz(numarg,argv); + /* restore stdout */ + fflush(stdout); + dup2(tmp_stdout, fileno(stdout)); + close(tmp_stdout); + clearerr(stdout); + fsetpos(stdout,&pos_stdout); + + /* restore stdin */ + dup2(tmp_stdin, fileno(stdin)); + close(tmp_stdin); + clearerr(stdin); + unlink(filename); return 0; diff --git a/src/flac/main.c b/src/flac/main.c index 55b60a45..3c19f1a9 100644 --- a/src/flac/main.c +++ b/src/flac/main.c @@ -1804,13 +1804,11 @@ int encode_file(const char *infilename, FLAC__bool is_first_file, FLAC__bool is_ return 1; } -#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION if(0 == strcmp(infilename, "-")) { infilesize = (FLAC__off_t)(-1); encode_infile = grabbag__file_get_binary_stdin(); } else -#endif { infilesize = grabbag__file_get_filesize(infilename); if(0 == (encode_infile = flac_fopen(infilename, "rb"))) { @@ -2363,12 +2361,6 @@ int decode_file(const char *infilename) decode_options.channel_map_none = option_values.channel_map_none; decode_options.format = output_format; -#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION - /* Can't fuzz from stdin */ - if(0 == strcmp(infilename, "-") || 0 == strcmp(outfilename, "-")) - return 1; -#endif - if(output_format == FORMAT_RAW) { decode_options.format_options.raw.is_big_endian = option_values.format_is_big_endian; decode_options.format_options.raw.is_unsigned_samples = option_values.format_is_unsigned_samples; -- cgit v1.2.3 From 67d2e1ee4c09ea28a2dae72750a1714f3b8294ef Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Thu, 23 Feb 2023 08:46:44 +0100 Subject: Add fuzzer for metaflac command-line tool --- oss-fuzz/Makefile.am | 28 +++++- oss-fuzz/tool_metaflac.c | 102 ++++++++++++++++++++++ src/metaflac/main.c | 4 + src/metaflac/operations_shorthand_cuesheet.c | 2 + src/metaflac/operations_shorthand_vorbiscomment.c | 2 + src/metaflac/usage.c | 1 + src/metaflac/utils.h | 5 ++ 7 files changed, 143 insertions(+), 1 deletion(-) create mode 100644 oss-fuzz/tool_metaflac.c diff --git a/oss-fuzz/Makefile.am b/oss-fuzz/Makefile.am index 4494a437..ef06486d 100644 --- a/oss-fuzz/Makefile.am +++ b/oss-fuzz/Makefile.am @@ -35,7 +35,7 @@ EXTRA_DIST = \ noinst_PROGRAMS = if USE_OSSFUZZERS -noinst_PROGRAMS += fuzzer_encoder fuzzer_encoder_v2 fuzzer_decoder fuzzer_seek fuzzer_metadata fuzzer_reencoder fuzzer_tool_flac +noinst_PROGRAMS += fuzzer_encoder fuzzer_encoder_v2 fuzzer_decoder fuzzer_seek fuzzer_metadata fuzzer_reencoder fuzzer_tool_flac fuzzer_tool_metaflac endif fuzzer_encoder_SOURCES = encoder.cc @@ -54,6 +54,16 @@ fuzzer_tool_flac_LDADD = \ $(top_builddir)/src/libFLAC/libFLAC.la \ @LTLIBICONV@ \ -lm +fuzzer_tool_metaflac_SOURCES = ${metaflac_SOURCES} empty.cc tool_metaflac.c # empty.cc is to force use of C++ linker, which is mandated by oss-fuzz +fuzzer_tool_metaflac_LDADD = \ + $(top_builddir)/src/share/utf8/libutf8.la \ + $(top_builddir)/src/share/grabbag/libgrabbag.la \ + $(top_builddir)/src/share/getopt/libgetopt.la \ + $(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \ + $(top_builddir)/src/share/replaygain_synthesis/libreplaygain_synthesis.la \ + $(top_builddir)/src/libFLAC/libFLAC.la \ + @LTLIBICONV@ \ + -lm flac_libs = \ $(top_builddir)/src/libFLAC/libFLAC-static.la \ @@ -76,3 +86,19 @@ flac_SOURCES = \ ${top_builddir}/src/flac/local_string_utils.h \ ${top_builddir}/src/flac/utils.h \ ${top_builddir}/src/flac/vorbiscomment.h + +metaflac_SOURCES = \ + ${top_builddir}/src/metaflac/operations.c \ + ${top_builddir}/src/metaflac/operations_shorthand_cuesheet.c \ + ${top_builddir}/src/metaflac/operations_shorthand_picture.c \ + ${top_builddir}/src/metaflac/operations_shorthand_seektable.c \ + ${top_builddir}/src/metaflac/operations_shorthand_streaminfo.c \ + ${top_builddir}/src/metaflac/operations_shorthand_vorbiscomment.c \ + ${top_builddir}/src/metaflac/options.c \ + ${top_builddir}/src/metaflac/usage.c \ + ${top_builddir}/src/metaflac/utils.c \ + ${top_builddir}/src/metaflac/operations.h \ + ${top_builddir}/src/metaflac/operations_shorthand.h \ + ${top_builddir}/src/metaflac/options.h \ + ${top_builddir}/src/metaflac/usage.h \ + ${top_builddir}/src/metaflac/utils.h diff --git a/oss-fuzz/tool_metaflac.c b/oss-fuzz/tool_metaflac.c new file mode 100644 index 00000000..a2941b3a --- /dev/null +++ b/oss-fuzz/tool_metaflac.c @@ -0,0 +1,102 @@ +/* fuzzer_tool_flac + * Copyright (C) 2023 Xiph.Org Foundation + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of the Xiph.org Foundation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include /* for memcpy */ +#define FUZZ_TOOL_METAFLAC +#define fprintf(...) +#define printf(...) +#include "../src/metaflac/main.c" +#include "common.h" + +int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size); + +int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) +{ + size_t size_left = size; + size_t arglen; + char * argv[64]; + char exename[] = "metaflac"; + char filename[] = "/tmp/fuzzXXXXXX"; + int numarg = 0, maxarg; + int file_to_fuzz; + int tmp_stderr, tmp_stdout; + fpos_t pos_stderr, pos_stdout; + + share__opterr = 0; + share__optind = 0; + + + if(size < 2) + return 0; + + maxarg = data[0] & 16; + size_left--; + + argv[0] = exename; + numarg++; + + /* Check whether input is zero delimited */ + while((arglen = strnlen((char *)data+(size-size_left),size_left)) < size_left && numarg < maxarg) { + argv[numarg++] = (char *)data+(size-size_left); + size_left -= arglen + 1; + } + + file_to_fuzz = mkstemp(filename); + + if (file_to_fuzz < 0) + abort(); + write(file_to_fuzz,data+(size-size_left),size_left); + close(file_to_fuzz); + + argv[numarg++] = filename; + + /* redirect stderr and stdout */ + fflush(stdout); + fgetpos(stdout,&pos_stdout); + tmp_stdout = dup(fileno(stdout)); + freopen("/dev/null","w",stdout); + + main_to_fuzz(numarg,argv); + + /* restore stderr and stdout */ + fflush(stdout); + dup2(tmp_stdout, fileno(stdout)); + close(tmp_stdout); + clearerr(stdout); + fsetpos(stdout,&pos_stdout); + + unlink(filename); + + return 0; +} + diff --git a/src/metaflac/main.c b/src/metaflac/main.c index cd488e7c..210c3b0d 100644 --- a/src/metaflac/main.c +++ b/src/metaflac/main.c @@ -28,7 +28,11 @@ #include #include "share/compat.h" +#ifndef FUZZ_TOOL_METAFLAC int main(int argc, char *argv[]) +#else +static int main_to_fuzz(int argc, char *argv[]) +#endif { CommandLineOptions options; int ret = 0; diff --git a/src/metaflac/operations_shorthand_cuesheet.c b/src/metaflac/operations_shorthand_cuesheet.c index 72154efb..2e500502 100644 --- a/src/metaflac/operations_shorthand_cuesheet.c +++ b/src/metaflac/operations_shorthand_cuesheet.c @@ -122,9 +122,11 @@ FLAC__bool import_cs_from(const char *filename, FLAC__StreamMetadata **cuesheet, flac_fprintf(stderr, "%s: ERROR: empty import file name\n", filename); return false; } +#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION if(0 == strcmp(cs_filename, "-")) f = stdin; else +#endif f = flac_fopen(cs_filename, "r"); if(0 == f) { diff --git a/src/metaflac/operations_shorthand_vorbiscomment.c b/src/metaflac/operations_shorthand_vorbiscomment.c index bf135d4b..c690fddf 100644 --- a/src/metaflac/operations_shorthand_vorbiscomment.c +++ b/src/metaflac/operations_shorthand_vorbiscomment.c @@ -347,9 +347,11 @@ FLAC__bool import_vc_from(const char *filename, FLAC__StreamMetadata *block, con flac_fprintf(stderr, "%s: ERROR: empty import file name\n", filename); return false; } +#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION if(0 == strcmp(vc_filename->value, "-")) f = stdin; else +#endif f = flac_fopen(vc_filename->value, "r"); if(0 == f) { diff --git a/src/metaflac/usage.c b/src/metaflac/usage.c index 62c2f1a8..d352d0b8 100644 --- a/src/metaflac/usage.c +++ b/src/metaflac/usage.c @@ -21,6 +21,7 @@ # include #endif +#include "utils.h" #include "usage.h" #include "FLAC/format.h" #include diff --git a/src/metaflac/utils.h b/src/metaflac/utils.h index 41c395be..cd2dfe4e 100644 --- a/src/metaflac/utils.h +++ b/src/metaflac/utils.h @@ -23,6 +23,11 @@ #include "FLAC/metadata.h" #include /* for FILE */ +#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION +#undef stderr +#define stderr stdout +#endif + void die(const char *message); #ifdef FLAC__VALGRIND_TESTING size_t local_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream); -- cgit v1.2.3 From cad22e0e3a22fe86419b1404cb4d44fd029a5928 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Thu, 23 Feb 2023 11:21:29 +0100 Subject: Prevent strcmp being used on invalid data --- src/metaflac/options.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/metaflac/options.c b/src/metaflac/options.c index 10d05906..c3768295 100644 --- a/src/metaflac/options.c +++ b/src/metaflac/options.c @@ -210,7 +210,7 @@ FLAC__bool parse_options(int argc, char *argv[], CommandLineOptions *options) } /* check for only one FLAC file used with certain options */ - if(options->num_files > 1) { + if(!had_error && options->num_files > 1) { if(0 != find_shorthand_operation(options, OP__IMPORT_CUESHEET_FROM)) { flac_fprintf(stderr, "ERROR: you may only specify one FLAC file when using '--import-cuesheet-from'\n"); had_error = true; -- cgit v1.2.3 From 5f39e88a88f39f7e508dc1fede30a2e0bb486008 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Fri, 17 Feb 2023 07:30:13 +0100 Subject: Fix strlen being used on uninitialized data --- src/metaflac/utils.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/metaflac/utils.c b/src/metaflac/utils.c index e3f27601..236fde4e 100644 --- a/src/metaflac/utils.c +++ b/src/metaflac/utils.c @@ -76,6 +76,11 @@ void local_strcat(char **dest, const char *source) *dest = safe_realloc_add_3op_(*dest, ndest, /*+*/nsource, /*+*/1); if(*dest == NULL) die("out of memory growing string"); + /* If ndest == 0, strlen in safe_strncat reads + * uninitialized data. To prevent that, set first character + * to zero */ + if(ndest == 0) + *dest[0] = 0; safe_strncat(*dest, source, outlen); } -- cgit v1.2.3 From 2568bf69aa917569864d7598a5b46d1344175b41 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Fri, 3 Mar 2023 07:49:42 +0100 Subject: Fix metaflac memory leak --- src/metaflac/operations_shorthand_seektable.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/metaflac/operations_shorthand_seektable.c b/src/metaflac/operations_shorthand_seektable.c index 50136581..2f6241c9 100644 --- a/src/metaflac/operations_shorthand_seektable.c +++ b/src/metaflac/operations_shorthand_seektable.c @@ -55,6 +55,7 @@ FLAC__bool do_shorthand_operation__add_seekpoints(const char *filename, FLAC__Me if(total_samples == 0) { flac_fprintf(stderr, "%s: ERROR: cannot add seekpoints because STREAMINFO block does not specify total_samples\n", filename); + FLAC__metadata_iterator_delete(iterator); return false; } @@ -68,6 +69,7 @@ FLAC__bool do_shorthand_operation__add_seekpoints(const char *filename, FLAC__Me if(!FLAC__metadata_iterator_insert_block_after(iterator, block)) { print_error_with_chain_status(chain, "%s: ERROR: adding new SEEKTABLE block to metadata", filename); FLAC__metadata_object_delete(block); + FLAC__metadata_iterator_delete(iterator); return false; } /* iterator is left pointing to new block */ -- cgit v1.2.3 From ac39a0078d467a7de207a951b5a5847c3e6cc5fb Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Fri, 17 Mar 2023 21:41:32 +0100 Subject: Improve fuzzer_tool_metaflac --- .gitignore | 1 + oss-fuzz/tool_metaflac.c | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 559bc69d..2b283c48 100644 --- a/.gitignore +++ b/.gitignore @@ -81,6 +81,7 @@ oss-fuzz/fuzzer_encoder oss-fuzz/fuzzer_encoder_v2 oss-fuzz/fuzzer_reencoder oss-fuzz/fuzzer_tool_flac +oss-fuzz/fuzzer_tool_metaflac /*[Bb]uild*/ /out/ diff --git a/oss-fuzz/tool_metaflac.c b/oss-fuzz/tool_metaflac.c index a2941b3a..549567f9 100644 --- a/oss-fuzz/tool_metaflac.c +++ b/oss-fuzz/tool_metaflac.c @@ -49,8 +49,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) char filename[] = "/tmp/fuzzXXXXXX"; int numarg = 0, maxarg; int file_to_fuzz; - int tmp_stderr, tmp_stdout; - fpos_t pos_stderr, pos_stdout; + int tmp_stdout; + fpos_t pos_stdout; share__opterr = 0; share__optind = 0; @@ -59,7 +59,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) if(size < 2) return 0; - maxarg = data[0] & 16; + maxarg = data[0] & 15; size_left--; argv[0] = exename; @@ -80,7 +80,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) argv[numarg++] = filename; - /* redirect stderr and stdout */ + /* redirect stdout */ fflush(stdout); fgetpos(stdout,&pos_stdout); tmp_stdout = dup(fileno(stdout)); @@ -88,7 +88,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) main_to_fuzz(numarg,argv); - /* restore stderr and stdout */ + /* restore stdout */ fflush(stdout); dup2(tmp_stdout, fileno(stdout)); close(tmp_stdout); -- cgit v1.2.3 From ae1db7147aff7c98c1e258fe82d120ed19531895 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Fri, 17 Mar 2023 21:42:16 +0100 Subject: Fix problems reading vorbis comment data being ignored --- src/libFLAC/metadata_iterators.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libFLAC/metadata_iterators.c b/src/libFLAC/metadata_iterators.c index ad8be8e1..ffcd5c35 100644 --- a/src/libFLAC/metadata_iterators.c +++ b/src/libFLAC/metadata_iterators.c @@ -2407,7 +2407,7 @@ FLAC__Metadata_SimpleIteratorStatus read_metadata_block_data_vorbis_comment_cb_( return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_SEEK_ERROR; } - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_OK; + return status; } FLAC__Metadata_SimpleIteratorStatus read_metadata_block_data_cuesheet_track_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Read read_cb, FLAC__StreamMetadata_CueSheet_Track *track) -- cgit v1.2.3 From eba4b6f63b18f87c6c4f77aef0910a5cd73248e4 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Fri, 17 Mar 2023 21:52:51 +0100 Subject: Check whether exceeding max seekpoints on growing seektable --- src/libFLAC/metadata_object.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libFLAC/metadata_object.c b/src/libFLAC/metadata_object.c index b013cfa0..174b1467 100644 --- a/src/libFLAC/metadata_object.c +++ b/src/libFLAC/metadata_object.c @@ -929,6 +929,9 @@ FLAC_API FLAC__bool FLAC__metadata_object_seektable_resize_points(FLAC__StreamMe FLAC__ASSERT(object != NULL); FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_SEEKTABLE); + if(new_num_points > ((2 << FLAC__STREAM_METADATA_LENGTH_LEN ) / FLAC__STREAM_METADATA_SEEKPOINT_LENGTH)) + return false; + if (object->data.seek_table.points == 0) { FLAC__ASSERT(object->data.seek_table.num_points == 0); if (new_num_points == 0) -- cgit v1.2.3 From b5c763d90806b788845a78c9fd3341637b442207 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Fri, 17 Mar 2023 21:55:05 +0100 Subject: Fix double free in iconvert code --- src/share/utf8/iconvert.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/share/utf8/iconvert.c b/src/share/utf8/iconvert.c index 876c06e8..307e0024 100644 --- a/src/share/utf8/iconvert.c +++ b/src/share/utf8/iconvert.c @@ -161,6 +161,8 @@ int iconvert(const char *fromcode, const char *tocode, /* Truncate the buffer to be tidy */ utflen = ob - utfbuf; + if (utflen == 0) + goto fail; newbuf = realloc(utfbuf, utflen); if (!newbuf) goto fail; -- cgit v1.2.3 From 5b145aff121a23775538667d57b8459545f855a3 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Fri, 17 Mar 2023 21:53:50 +0100 Subject: Convert asserts into explicit checks An assert checking whether the bit depth of a FLAC file was valid was triggered by fuzzing. This assert is converted to a explicit check. Similarly, an assert was triggered with a file of sample rate 0 when trying to add seekpoints spaced with seconds. --- src/metaflac/operations.c | 5 ++++- src/share/grabbag/seektable.c | 3 +-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/metaflac/operations.c b/src/metaflac/operations.c index 09b225cc..63d9ae52 100644 --- a/src/metaflac/operations.c +++ b/src/metaflac/operations.c @@ -444,8 +444,11 @@ FLAC__bool do_shorthand_operation__add_replay_gain(char **filenames, unsigned nu flac_fprintf(stderr, "%s: ERROR: # of channels (%u) is not supported, must be 1 or 2\n", filenames[i], channels); return false; } + if(bits_per_sample < FLAC__MIN_BITS_PER_SAMPLE || bits_per_sample > FLAC__MAX_BITS_PER_SAMPLE) { + flac_fprintf(stderr, "%s: ERROR: resolution (%u) is not supported, must be between %u and %u\n", filenames[i], bits_per_sample, FLAC__MIN_BITS_PER_SAMPLE, FLAC__MAX_BITS_PER_SAMPLE); + return false; + } } - FLAC__ASSERT(bits_per_sample >= FLAC__MIN_BITS_PER_SAMPLE && bits_per_sample <= FLAC__MAX_BITS_PER_SAMPLE); if(!grabbag__replaygain_init(sample_rate)) { FLAC__ASSERT(0); diff --git a/src/share/grabbag/seektable.c b/src/share/grabbag/seektable.c index 96b56c31..acc03fc7 100644 --- a/src/share/grabbag/seektable.c +++ b/src/share/grabbag/seektable.c @@ -61,8 +61,7 @@ FLAC__bool grabbag__seektable_convert_specification_to_template(const char *spec } } else if(q[-1] == 's') { /* -S #s */ - if(total_samples_to_encode > 0) { /* we can only do these if we know the number of samples to encode up front */ - FLAC__ASSERT(sample_rate > 0); + if(total_samples_to_encode > 0 && sample_rate > 0) { /* we can only do these if we know the number of samples and sample rate to encode up front */ if(0 != spec_has_real_points) *spec_has_real_points = true; if(!only_explicit_placeholders) { -- cgit v1.2.3 From eed37c39faee2442c806aff1594225ee2a9e3aae Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Sun, 19 Mar 2023 15:50:02 +0100 Subject: Enable fuzzer_tool_metaflac to fuzz with stdin --- oss-fuzz/tool_metaflac.c | 40 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/oss-fuzz/tool_metaflac.c b/oss-fuzz/tool_metaflac.c index 549567f9..a6fafa26 100644 --- a/oss-fuzz/tool_metaflac.c +++ b/oss-fuzz/tool_metaflac.c @@ -47,10 +47,12 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) char * argv[64]; char exename[] = "metaflac"; char filename[] = "/tmp/fuzzXXXXXX"; + char filename_stdin[] = "/tmp/fuzzXXXXXX"; int numarg = 0, maxarg; int file_to_fuzz; - int tmp_stdout; + int tmp_stdout, tmp_stdin; fpos_t pos_stdout; + bool use_stdin = false; share__opterr = 0; share__optind = 0; @@ -60,6 +62,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) return 0; maxarg = data[0] & 15; + use_stdin = data[0] & 16; size_left--; argv[0] = exename; @@ -71,21 +74,44 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) size_left -= arglen + 1; } + /* Create file to feed directly */ file_to_fuzz = mkstemp(filename); - if (file_to_fuzz < 0) abort(); - write(file_to_fuzz,data+(size-size_left),size_left); + if(use_stdin) { + write(file_to_fuzz,data+(size-size_left),size_left/2); + size_left -= size_left/2; + } + else + write(file_to_fuzz,data+(size-size_left),size_left); close(file_to_fuzz); argv[numarg++] = filename; + /* Create file to feed to stdin */ + if(use_stdin) { + file_to_fuzz = mkstemp(filename_stdin); + if (file_to_fuzz < 0) + abort(); + write(file_to_fuzz,data+(size-size_left),size_left); + close(file_to_fuzz); + } + /* redirect stdout */ fflush(stdout); fgetpos(stdout,&pos_stdout); tmp_stdout = dup(fileno(stdout)); freopen("/dev/null","w",stdout); + /* redirect stdin */ + tmp_stdin = dup(fileno(stdin)); + if(use_stdin) + freopen(filename_stdin,"r",stdin); + else { + freopen("/dev/null","r",stdin); + argv[numarg++] = filename; + } + main_to_fuzz(numarg,argv); /* restore stdout */ @@ -95,8 +121,16 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) clearerr(stdout); fsetpos(stdout,&pos_stdout); + /* restore stdin */ + dup2(tmp_stdin, fileno(stdin)); + close(tmp_stdin); + clearerr(stdin); + unlink(filename); + if(use_stdin) + unlink(filename_stdin); + return 0; } -- cgit v1.2.3 From b54eabdf0d7ba6446adac799dd37eafa7a21f183 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Mon, 13 Feb 2023 20:07:49 +0100 Subject: Add API function FLAC__metadata_object_get_raw Add an API function to directly output binary FLAC data corresponding to a certain FLAC__StreamMetadata struct --- include/FLAC/metadata.h | 14 +++++++ .../include/private/stream_encoder_framing.h | 2 +- src/libFLAC/metadata_object.c | 43 ++++++++++++++++++++++ src/libFLAC/stream_encoder.c | 6 +-- src/libFLAC/stream_encoder_framing.c | 20 +++++++--- 5 files changed, 75 insertions(+), 10 deletions(-) diff --git a/include/FLAC/metadata.h b/include/FLAC/metadata.h index 651b7405..0e1fcf02 100644 --- a/include/FLAC/metadata.h +++ b/include/FLAC/metadata.h @@ -2197,6 +2197,20 @@ FLAC_API FLAC__bool FLAC__metadata_object_picture_set_data(FLAC__StreamMetadata */ FLAC_API FLAC__bool FLAC__metadata_object_picture_is_legal(const FLAC__StreamMetadata *object, const char **violation); + +/** Get the raw (binary) representation of a FLAC__StreamMetadata objeect. + * After use, free() the returned buffer. The length of the buffer is + * the length of the input metadata object plus 4 bytes for the header. + * + * \param object A pointer to metadata block to be converted. + * \assert + * \code object != NULL \endcode + * \retval FLAC__byte* + * \c NULL if there was an error, else a pointer to a buffer holding + * the requested data. + */ +FLAC_API FLAC__byte * FLAC__metadata_object_get_raw(const FLAC__StreamMetadata *object); + /* \} */ #ifdef __cplusplus diff --git a/src/libFLAC/include/private/stream_encoder_framing.h b/src/libFLAC/include/private/stream_encoder_framing.h index 2799c698..de2052ae 100644 --- a/src/libFLAC/include/private/stream_encoder_framing.h +++ b/src/libFLAC/include/private/stream_encoder_framing.h @@ -36,7 +36,7 @@ #include "FLAC/format.h" #include "bitwriter.h" -FLAC__bool FLAC__add_metadata_block(const FLAC__StreamMetadata *metadata, FLAC__BitWriter *bw); +FLAC__bool FLAC__add_metadata_block(const FLAC__StreamMetadata *metadata, FLAC__BitWriter *bw, FLAC__bool update_vendor_string); FLAC__bool FLAC__frame_add_header(const FLAC__FrameHeader *header, FLAC__BitWriter *bw); FLAC__bool FLAC__subframe_add_constant(const FLAC__Subframe_Constant *subframe, uint32_t subframe_bps, uint32_t wasted_bits, FLAC__BitWriter *bw); FLAC__bool FLAC__subframe_add_fixed(const FLAC__Subframe_Fixed *subframe, uint32_t residual_samples, uint32_t subframe_bps, uint32_t wasted_bits, FLAC__BitWriter *bw); diff --git a/src/libFLAC/metadata_object.c b/src/libFLAC/metadata_object.c index 174b1467..a73f2173 100644 --- a/src/libFLAC/metadata_object.c +++ b/src/libFLAC/metadata_object.c @@ -39,6 +39,7 @@ #include "private/metadata.h" #include "private/memory.h" +#include "private/stream_encoder_framing.h" #include "FLAC/assert.h" #include "share/alloc.h" @@ -1855,3 +1856,45 @@ FLAC_API FLAC__bool FLAC__metadata_object_picture_is_legal(const FLAC__StreamMet return FLAC__format_picture_is_legal(&object->data.picture, violation); } + +FLAC_API FLAC__byte * FLAC__metadata_object_get_raw(const FLAC__StreamMetadata *object) +{ + FLAC__BitWriter *bw; + const FLAC__byte * buffer; + FLAC__byte * output; + size_t bytes; + + FLAC__ASSERT(object != NULL); + + if((bw = FLAC__bitwriter_new()) == NULL) + return 0; + if(!FLAC__bitwriter_init(bw)) { + FLAC__bitwriter_delete(bw); + return 0; + } + if(!FLAC__add_metadata_block(object, bw, false)) { + FLAC__bitwriter_delete(bw); + return 0; + } + + if(!FLAC__bitwriter_get_buffer(bw, &buffer, &bytes)) { + FLAC__bitwriter_delete(bw); + return 0; + } + + /* Extra check whether length of bitwriter agrees with length of metadata block */ + if(bytes != (object->length+FLAC__STREAM_METADATA_HEADER_LENGTH)) { + FLAC__bitwriter_delete(bw); + return 0; + } + + output = safe_malloc_(bytes); + if(output == 0) { + FLAC__bitwriter_delete(bw); + return 0; + } + + memcpy(output,buffer,bytes); + FLAC__bitwriter_delete(bw); + return output; +} diff --git a/src/libFLAC/stream_encoder.c b/src/libFLAC/stream_encoder.c index 189b1203..5a13637b 100644 --- a/src/libFLAC/stream_encoder.c +++ b/src/libFLAC/stream_encoder.c @@ -1209,7 +1209,7 @@ static FLAC__StreamEncoderInitStatus init_stream_internal_( memset(encoder->private_->streaminfo.data.stream_info.md5sum, 0, 16); /* we don't know this yet; have to fill it in later */ if(encoder->protected_->do_md5) FLAC__MD5Init(&encoder->private_->md5context); - if(!FLAC__add_metadata_block(&encoder->private_->streaminfo, encoder->private_->frame)) { + if(!FLAC__add_metadata_block(&encoder->private_->streaminfo, encoder->private_->frame, true)) { encoder->protected_->state = FLAC__STREAM_ENCODER_FRAMING_ERROR; return FLAC__STREAM_ENCODER_INIT_STATUS_ENCODER_ERROR; } @@ -1245,7 +1245,7 @@ static FLAC__StreamEncoderInitStatus init_stream_internal_( vorbis_comment.data.vorbis_comment.vendor_string.entry = 0; vorbis_comment.data.vorbis_comment.num_comments = 0; vorbis_comment.data.vorbis_comment.comments = 0; - if(!FLAC__add_metadata_block(&vorbis_comment, encoder->private_->frame)) { + if(!FLAC__add_metadata_block(&vorbis_comment, encoder->private_->frame, true)) { encoder->protected_->state = FLAC__STREAM_ENCODER_FRAMING_ERROR; return FLAC__STREAM_ENCODER_INIT_STATUS_ENCODER_ERROR; } @@ -1260,7 +1260,7 @@ static FLAC__StreamEncoderInitStatus init_stream_internal_( */ for(i = 0; i < encoder->protected_->num_metadata_blocks; i++) { encoder->protected_->metadata[i]->is_last = (i == encoder->protected_->num_metadata_blocks - 1); - if(!FLAC__add_metadata_block(encoder->protected_->metadata[i], encoder->private_->frame)) { + if(!FLAC__add_metadata_block(encoder->protected_->metadata[i], encoder->private_->frame, true)) { encoder->protected_->state = FLAC__STREAM_ENCODER_FRAMING_ERROR; return FLAC__STREAM_ENCODER_INIT_STATUS_ENCODER_ERROR; } diff --git a/src/libFLAC/stream_encoder_framing.c b/src/libFLAC/stream_encoder_framing.c index 0a7095ab..27a37c2f 100644 --- a/src/libFLAC/stream_encoder_framing.c +++ b/src/libFLAC/stream_encoder_framing.c @@ -44,7 +44,7 @@ static FLAC__bool add_entropy_coding_method_(FLAC__BitWriter *bw, const FLAC__EntropyCodingMethod *method); static FLAC__bool add_residual_partitioned_rice_(FLAC__BitWriter *bw, const FLAC__int32 residual[], const uint32_t residual_samples, const uint32_t predictor_order, const uint32_t rice_parameters[], const uint32_t raw_bits[], const uint32_t partition_order, const FLAC__bool is_extended); -FLAC__bool FLAC__add_metadata_block(const FLAC__StreamMetadata *metadata, FLAC__BitWriter *bw) +FLAC__bool FLAC__add_metadata_block(const FLAC__StreamMetadata *metadata, FLAC__BitWriter *bw, FLAC__bool update_vendor_string) { uint32_t i, j, metadata_length; const uint32_t vendor_string_length = (uint32_t)strlen(FLAC__VENDOR_STRING); @@ -62,7 +62,7 @@ FLAC__bool FLAC__add_metadata_block(const FLAC__StreamMetadata *metadata, FLAC__ * First, for VORBIS_COMMENTs, adjust the length to reflect our vendor string */ metadata_length = metadata->length; - if(metadata->type == FLAC__METADATA_TYPE_VORBIS_COMMENT) { + if(metadata->type == FLAC__METADATA_TYPE_VORBIS_COMMENT && update_vendor_string) { FLAC__ASSERT(metadata->data.vorbis_comment.vendor_string.length == 0 || 0 != metadata->data.vorbis_comment.vendor_string.entry); metadata_length -= metadata->data.vorbis_comment.vendor_string.length; metadata_length += vendor_string_length; @@ -130,10 +130,18 @@ FLAC__bool FLAC__add_metadata_block(const FLAC__StreamMetadata *metadata, FLAC__ } break; case FLAC__METADATA_TYPE_VORBIS_COMMENT: - if(!FLAC__bitwriter_write_raw_uint32_little_endian(bw, vendor_string_length)) - return false; - if(!FLAC__bitwriter_write_byte_block(bw, (const FLAC__byte*)FLAC__VENDOR_STRING, vendor_string_length)) - return false; + if(update_vendor_string) { + if(!FLAC__bitwriter_write_raw_uint32_little_endian(bw, vendor_string_length)) + return false; + if(!FLAC__bitwriter_write_byte_block(bw, (const FLAC__byte*)FLAC__VENDOR_STRING, vendor_string_length)) + return false; + } + else { + if(!FLAC__bitwriter_write_raw_uint32_little_endian(bw, metadata->data.vorbis_comment.vendor_string.length)) + return false; + if(!FLAC__bitwriter_write_byte_block(bw, metadata->data.vorbis_comment.vendor_string.entry, metadata->data.vorbis_comment.vendor_string.length)) + return false; + } if(!FLAC__bitwriter_write_raw_uint32_little_endian(bw, metadata->data.vorbis_comment.num_comments)) return false; for(i = 0; i < metadata->data.vorbis_comment.num_comments; i++) { -- cgit v1.2.3 From b3b91763304c01eb9e743064feaf91dd9c2d16d6 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Mon, 13 Feb 2023 13:56:18 +0100 Subject: Add data-format option to metaflac, enabling binary output --- man/metaflac.md | 7 +++++++ src/metaflac/operations.c | 26 ++++++++++++++++++++++++-- src/metaflac/options.c | 16 ++++++++++++++-- src/metaflac/options.h | 3 +++ src/metaflac/usage.c | 13 +++++++------ 5 files changed, 55 insertions(+), 10 deletions(-) diff --git a/man/metaflac.md b/man/metaflac.md index d15c36d0..9efc827a 100644 --- a/man/metaflac.md +++ b/man/metaflac.md @@ -261,6 +261,13 @@ modification time is set to the current time): application data contents instead using \--application-data-format=hexdump. +**\--data-format=binary\|binary-headerless\|text** +: By default a human-readable text representation of the data is + displayed. You may specify --data-format=binary to dump the raw + binary form of each metadata block. Specify + --data-format=binary-headerless to omit output of metadata block + headers, including the id of APPLICATION metadata blocks. + **\--remove-all** : Remove all metadata blocks (except the STREAMINFO block) from the metadata. Unless \--dont-use-padding is specified, the blocks will be diff --git a/src/metaflac/operations.c b/src/metaflac/operations.c index 63d9ae52..c8f5b37d 100644 --- a/src/metaflac/operations.c +++ b/src/metaflac/operations.c @@ -49,6 +49,7 @@ static FLAC__bool do_shorthand_operation__add_padding(const char *filename, FLAC static FLAC__bool passes_filter(const CommandLineOptions *options, const FLAC__StreamMetadata *block, unsigned block_number); static void write_metadata(const char *filename, FLAC__StreamMetadata *block, unsigned block_number, FLAC__bool raw, FLAC__bool hexdump_application); +static void write_metadata_binary(FLAC__StreamMetadata *block, FLAC__byte *block_raw, FLAC__bool headerless); /* from operations_shorthand_seektable.c */ extern FLAC__bool do_shorthand_operation__add_seekpoints(const char *filename, FLAC__Metadata_Chain *chain, const char *specification, FLAC__bool *needs_write); @@ -189,8 +190,19 @@ FLAC__bool do_major_operation__list(const char *filename, FLAC__Metadata_Chain * ok &= (0 != block); if(!ok) flac_fprintf(stderr, "%s: ERROR: couldn't get block from chain\n", filename); - else if(passes_filter(options, FLAC__metadata_iterator_get_block(iterator), block_number)) - write_metadata(filename, block, block_number, !options->utf8_convert, options->application_data_format_is_hexdump); + else if(passes_filter(options, FLAC__metadata_iterator_get_block(iterator), block_number)) { + if(!options->data_format_is_binary && !options->data_format_is_binary_headerless) + write_metadata(filename, block, block_number, !options->utf8_convert, options->application_data_format_is_hexdump); + else { + FLAC__byte * block_raw = FLAC__metadata_object_get_raw(block); + if(block_raw == 0) { + flac_fprintf(stderr, "%s: ERROR: couldn't get block in raw form\n", filename); + return false; + } + write_metadata_binary(block, block_raw, options->data_format_is_binary_headerless); + free(block_raw); + } + } block_number++; } while(ok && FLAC__metadata_iterator_next(iterator)); @@ -675,3 +687,13 @@ void write_metadata(const char *filename, FLAC__StreamMetadata *block, unsigned } #undef PPR } + +void write_metadata_binary(FLAC__StreamMetadata *block, FLAC__byte *block_raw, FLAC__bool headerless) +{ + if(!headerless) + local_fwrite(block_raw, 1, block->length+FLAC__STREAM_METADATA_HEADER_LENGTH, stdout); + else if(block->type == FLAC__METADATA_TYPE_APPLICATION && block->length > 3) + local_fwrite(block_raw+FLAC__STREAM_METADATA_HEADER_LENGTH+4, 1, block->length-4, stdout); + else + local_fwrite(block_raw+FLAC__STREAM_METADATA_HEADER_LENGTH, 1, block->length, stdout); +} diff --git a/src/metaflac/options.c b/src/metaflac/options.c index c3768295..b2fb0f1b 100644 --- a/src/metaflac/options.c +++ b/src/metaflac/options.c @@ -139,6 +139,8 @@ void init_options(CommandLineOptions *options) options->cued_seekpoints = true; options->show_long_help = false; options->show_version = false; + options->data_format_is_binary = false; + options->data_format_is_binary_headerless = false; options->application_data_format_is_hexdump = false; options->ops.operations = 0; @@ -713,6 +715,8 @@ FLAC__bool parse_option(int option_index, const char *option_argument, CommandLi flac_fprintf(stderr, "ERROR (--%s): illegal data format \"%s\"\n", opt, option_argument); ok = false; } + options->data_format_is_binary = arg->value.data_format.is_binary; + options->data_format_is_binary_headerless = arg->value.data_format.is_headerless; } else if(0 == strcmp(opt, "application-data-format")) { FLAC__ASSERT(0 != option_argument); @@ -1108,10 +1112,18 @@ FLAC__bool parse_block_type(const char *in, Argument_BlockType *out) FLAC__bool parse_data_format(const char *in, Argument_DataFormat *out) { - if(0 == strcmp(in, "binary")) + if(0 == strcmp(in, "binary-headerless")) { + out->is_binary = false; + out->is_headerless = true; + } + else if(0 == strcmp(in, "binary")) { out->is_binary = true; - else if(0 == strcmp(in, "text")) + out->is_headerless = false; + } + else if(0 == strcmp(in, "text")) { out->is_binary = false; + out->is_headerless = false; + } else return false; return true; diff --git a/src/metaflac/options.h b/src/metaflac/options.h index d13e2d88..7409f60a 100644 --- a/src/metaflac/options.h +++ b/src/metaflac/options.h @@ -131,6 +131,7 @@ typedef struct { typedef struct { FLAC__bool is_binary; + FLAC__bool is_headerless; } Argument_DataFormat; typedef struct { @@ -190,6 +191,8 @@ typedef struct { FLAC__bool cued_seekpoints; FLAC__bool show_long_help; FLAC__bool show_version; + FLAC__bool data_format_is_binary; + FLAC__bool data_format_is_binary_headerless; FLAC__bool application_data_format_is_hexdump; struct { Operation *operations; diff --git a/src/metaflac/usage.c b/src/metaflac/usage.c index d352d0b8..f9fcf0a5 100644 --- a/src/metaflac/usage.c +++ b/src/metaflac/usage.c @@ -275,15 +275,16 @@ int long_usage(const char *message, ...) fprintf(out, " NOTE: if both --block-number and --[except-]block-type are specified,\n"); fprintf(out, " the result is the logical AND of both arguments.\n"); fprintf(out, "\n"); -#if 0 - /*@@@ not implemented yet */ - fprintf(out, " --data-format=binary|text\n"); + fprintf(out, " --data-format=binary|binary-headerless|text\n"); fprintf(out, " By default a human-readable text representation of the data is displayed.\n"); fprintf(out, " You may specify --data-format=binary to dump the raw binary form of each\n"); - fprintf(out, " metadata block. The output can be read in using a subsequent call to\n"); - fprintf(out, " "metaflac --append --from-file=..."\n"); - fprintf(out, "\n"); + fprintf(out, " metadata block. Specify --data-format=binary-headerless to omit output of\n"); + fprintf(out, " metadata block headers, including the id of APPLICATION metadata blocks.\n"); +#if 0 + fprintf(out, " The output can be read in using a subsequent call\n"); + fprintf(out, " to \"metaflac --append --from-file=...\"\n"); #endif + fprintf(out, "\n"); fprintf(out, " --application-data-format=hexdump|text\n"); fprintf(out, " If the application block you are displaying contains binary data but your\n"); fprintf(out, " --data-format=text, you can display a hex dump of the application data\n"); -- cgit v1.2.3 From 904d02751874a8c9961ef6f8c394b31ff0d910dd Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Mon, 13 Feb 2023 20:51:09 +0100 Subject: Add test for metaflac --data-format=binary-headerless --- test/metaflac-test-files/Makefile.am | 3 ++- test/metaflac-test-files/case65-expect.meta | Bin 0 -> 1672 bytes test/test_metaflac.sh | 16 ++++++++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 test/metaflac-test-files/case65-expect.meta diff --git a/test/metaflac-test-files/Makefile.am b/test/metaflac-test-files/Makefile.am index c56ddaf5..11134c01 100644 --- a/test/metaflac-test-files/Makefile.am +++ b/test/metaflac-test-files/Makefile.am @@ -81,7 +81,8 @@ EXTRA_DIST = \ case61-expect.meta \ case62-expect.meta \ case63-expect.meta \ - case64-expect.meta + case64-expect.meta \ + case65-expect.meta clean-local: -rm -f out.* diff --git a/test/metaflac-test-files/case65-expect.meta b/test/metaflac-test-files/case65-expect.meta new file mode 100644 index 00000000..3f863b17 Binary files /dev/null and b/test/metaflac-test-files/case65-expect.meta differ diff --git a/test/test_metaflac.sh b/test/test_metaflac.sh index e150e1bd..7c71f240 100755 --- a/test/test_metaflac.sh +++ b/test/test_metaflac.sh @@ -113,6 +113,19 @@ metaflac_test () echo OK } +metaflac_test_binary () +{ + case="$testdatadir/$1" + desc="$2" + args="$3" + expect="$case-expect.meta" + echo $ECHO_N "test $1: $desc... " $ECHO_C + run_metaflac $args $flacfile > $testdir/out.meta || die "ERROR running metaflac" + cmp $expect $testdir/out.meta || die "ERROR: metadata does not match expected $expect" + # To blindly accept (and check later): cp -f $testdir/out.meta $expect + echo OK +} + metaflac_test case00 "--list" "--list" metaflac_test case01 "STREAMINFO --show-* shortcuts" " @@ -375,6 +388,9 @@ metaflac_test case63 "--remove-all-tags-except=artist=title" "--list" metaflac_test case64 "--export-tags-to=-" "--export-tags-to=-" metaflac_test case64 "--show-all-tags" "--show-all-tags" +run_flac ${top_srcdir}/test/foreign-metadata-test-files/AIFF-ID3.aiff --keep-foreign-metadata -f -o $flacfile +metaflac_test_binary case65 "--data-format=binary" "--list --data-format=binary-headerless --block-type=APPLICATION:aiff" + # UNKNOWN blocks echo $ECHO_N "Testing FLAC file with unknown metadata... " $ECHO_C cp -p ${top_srcdir}/test/metaflac.flac.in $flacfile -- cgit v1.2.3 From b11677e052e7c0c88426bf72c364569df1dde36c Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Tue, 14 Feb 2023 19:21:07 +0100 Subject: Add API function FLAC__metadata_object_set_raw Add an API function to directly input binary FLAC data to get a FLAC__StreamMetadata struct. The use mirrors FLAC__metadata_object_get_raw --- include/FLAC/metadata.h | 14 +++++ src/libFLAC/metadata_object.c | 118 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 132 insertions(+) diff --git a/include/FLAC/metadata.h b/include/FLAC/metadata.h index 0e1fcf02..b7010342 100644 --- a/include/FLAC/metadata.h +++ b/include/FLAC/metadata.h @@ -2211,6 +2211,20 @@ FLAC_API FLAC__bool FLAC__metadata_object_picture_is_legal(const FLAC__StreamMet */ FLAC_API FLAC__byte * FLAC__metadata_object_get_raw(const FLAC__StreamMetadata *object); + +/** Turn a raw (binary) representation into a FLAC__StreamMetadata objeect. + * The returned object must be deleted with FLAC__metadata_object_delete() + * after use. + * + * \param buffer A pointer to a buffer containing a binary representation + * to be converted to a FLAC__StreamMetadata object + * \param length The length of the supplied buffer + * \retval FLAC__StreamMetadata* + * \c NULL if there was an error, else a pointer to a FLAC__StreamMetadata + * holding the requested data. + */ + +FLAC_API FLAC__StreamMetadata * FLAC__metadata_object_set_raw(FLAC__byte *buffer, FLAC__uint32 length); /* \} */ #ifdef __cplusplus diff --git a/src/libFLAC/metadata_object.c b/src/libFLAC/metadata_object.c index a73f2173..b7e89549 100644 --- a/src/libFLAC/metadata_object.c +++ b/src/libFLAC/metadata_object.c @@ -42,6 +42,7 @@ #include "private/stream_encoder_framing.h" #include "FLAC/assert.h" +#include "FLAC/stream_decoder.h" #include "share/alloc.h" #include "share/compat.h" @@ -1898,3 +1899,120 @@ FLAC_API FLAC__byte * FLAC__metadata_object_get_raw(const FLAC__StreamMetadata * FLAC__bitwriter_delete(bw); return output; } + +/* The following callbacks are for FLAC__metadata_object_set_raw */ + +static FLAC__StreamDecoderReadStatus read_callback_(const FLAC__StreamDecoder *decoder, FLAC__byte *buffer, size_t *bytes, void *client_data); +static FLAC__StreamDecoderWriteStatus write_callback_(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data); +static void metadata_callback_(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data); +static void error_callback_(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data); + +typedef struct { + FLAC__StreamMetadata *object; + FLAC__bool got_error; + FLAC__byte *buffer; + FLAC__int32 length; + FLAC__int32 tell; +} set_raw_client_data; + +FLAC_API FLAC__StreamMetadata * FLAC__metadata_object_set_raw(FLAC__byte *buffer, FLAC__uint32 length) +{ + set_raw_client_data cd; + FLAC__StreamDecoder * decoder; + + cd.buffer = buffer; + cd.length = length; + cd.got_error = false; + cd.object = 0; + cd.tell = -4; + + decoder = FLAC__stream_decoder_new(); + + if(0 == decoder) + return 0; + + FLAC__stream_decoder_set_md5_checking(decoder, false); + FLAC__stream_decoder_set_metadata_respond_all(decoder); + + if(FLAC__stream_decoder_init_stream(decoder, read_callback_, NULL, NULL, NULL, NULL, write_callback_, metadata_callback_, error_callback_, &cd) != FLAC__STREAM_DECODER_INIT_STATUS_OK || cd.got_error) { + (void)FLAC__stream_decoder_finish(decoder); + FLAC__stream_decoder_delete(decoder); + return 0; + } + + if((!FLAC__stream_decoder_process_until_end_of_metadata(decoder) && FLAC__stream_decoder_get_state(decoder) != FLAC__STREAM_DECODER_END_OF_STREAM) || cd.got_error) { + (void)FLAC__stream_decoder_finish(decoder); + FLAC__stream_decoder_delete(decoder); + if(0 != cd.object) + FLAC__metadata_object_delete(cd.object); + return 0; + } + + (void)FLAC__stream_decoder_finish(decoder); + FLAC__stream_decoder_delete(decoder); + + return cd.object; + +} + +FLAC__StreamDecoderReadStatus read_callback_(const FLAC__StreamDecoder *decoder, FLAC__byte *buffer, size_t *bytes, void *client_data) +{ + set_raw_client_data *cd = (set_raw_client_data *)client_data; + (void)decoder; + + if(cd->tell == -4) { + if(*bytes < 4) + return FLAC__STREAM_DECODER_READ_STATUS_ABORT; + buffer[0] = 'f'; + buffer[1] = 'L'; + buffer[2] = 'a'; + buffer[3] = 'C'; + *bytes = 4; + cd->tell = 0; + return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE; + } + else if(cd->tell < 0) + return FLAC__STREAM_DECODER_READ_STATUS_ABORT; + else if(cd->tell == cd->length) { + *bytes = 0; + return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM; + } + else { + if((FLAC__int32)(*bytes) > (cd->length - cd->tell)) + *bytes = cd->length - cd->tell; + memcpy(buffer, cd->buffer+cd->tell, *bytes); + cd->tell += *bytes; + return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE; + } +} + +FLAC__StreamDecoderWriteStatus write_callback_(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data) +{ + (void)decoder, (void)frame, (void)buffer, (void)client_data; + + return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE; +} + +void metadata_callback_(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data) +{ + set_raw_client_data *cd = (set_raw_client_data *)client_data; + (void)decoder; + + /* + * we assume we only get here when the one metadata block we were + * looking for was passed to us + */ + if(!cd->got_error && 0 == cd->object) { + if(0 == (cd->object = FLAC__metadata_object_clone(metadata))) + cd->got_error = true; + } +} + +void error_callback_(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data) +{ + set_raw_client_data *cd = (set_raw_client_data *)client_data; + (void)decoder; + + if(status != FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC) + cd->got_error = true; +} -- cgit v1.2.3 From 8e563a697d2d0966291511c306631ccb1a4090f2 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Tue, 14 Feb 2023 20:31:39 +0100 Subject: Add --append option to metaflac --- src/metaflac/operations.c | 68 ++++++++++++++++++++++++++++++++++++++++++++--- src/metaflac/usage.c | 10 +++---- 2 files changed, 69 insertions(+), 9 deletions(-) diff --git a/src/metaflac/operations.c b/src/metaflac/operations.c index c8f5b37d..e29311b5 100644 --- a/src/metaflac/operations.c +++ b/src/metaflac/operations.c @@ -213,9 +213,71 @@ FLAC__bool do_major_operation__list(const char *filename, FLAC__Metadata_Chain * FLAC__bool do_major_operation__append(FLAC__Metadata_Chain *chain, const CommandLineOptions *options) { - (void) chain, (void) options; - flac_fprintf(stderr, "ERROR: --append not implemented yet\n"); - return false; + FLAC__byte header[FLAC__STREAM_METADATA_HEADER_LENGTH]; + FLAC__byte *buffer; + FLAC__uint32 buffer_size, num_objects = 0, i, append_after = UINT32_MAX; + FLAC__StreamMetadata *object; + FLAC__Metadata_Iterator *iterator; + + /* First, find out after which block appending should take place */ + for(i = 0; i < options->args.num_arguments; i++) { + if(options->args.arguments[i].type == ARG__BLOCK_NUMBER) { + if(append_after != UINT32_MAX || options->args.arguments[i].value.block_number.num_entries > 1) { + flac_fprintf(stderr, "ERROR: more than one block number specified with --append\n"); + return false; + } + append_after = options->args.arguments[i].value.block_number.entries[0]; + } + } + + iterator = FLAC__metadata_iterator_new(); + + if(0 == iterator) + die("out of memory allocating iterator"); + + FLAC__metadata_iterator_init(iterator, chain); + + /* Go to requested block */ + for(i = 0; i < append_after; i++) { + if(!FLAC__metadata_iterator_next(iterator)) + break; + } + + /* Read header from stdin */ + while(fread(header, 1, FLAC__STREAM_METADATA_HEADER_LENGTH, stdin) == FLAC__STREAM_METADATA_HEADER_LENGTH) { + + buffer_size = ((FLAC__uint32)(header[1]) << 16) + ((FLAC__uint32)(header[2]) << 8) + header[3]; + buffer = safe_malloc_(buffer_size + FLAC__STREAM_METADATA_HEADER_LENGTH); + memcpy(buffer, header, FLAC__STREAM_METADATA_HEADER_LENGTH); + + if(fread(buffer+FLAC__STREAM_METADATA_HEADER_LENGTH, 1, buffer_size, stdin) < buffer_size) { + flac_fprintf(stderr, "ERROR: couldn't read metadata block #%u from stdin\n",(num_objects+1)); + free(buffer); + break; + } + + if((object = FLAC__metadata_object_set_raw(buffer, buffer_size + FLAC__STREAM_METADATA_HEADER_LENGTH)) == NULL) { + flac_fprintf(stderr, "ERROR: couldn't parse supplied metadata block #%u\n",(num_objects+1)); + free(buffer); + break; + } + free(buffer); + + if(!FLAC__metadata_iterator_insert_block_after(iterator, object)) { + flac_fprintf(stderr, "ERROR: couldn't add supplied metadata block #%u to file\n",(num_objects+1)); + FLAC__metadata_object_delete(object); + FLAC__metadata_iterator_delete(iterator); + break; + } + num_objects++; + } + + if(num_objects == 0) + flac_fprintf(stderr, "ERROR: unable to find a metadata block in the supplied input\n"); + + FLAC__metadata_iterator_delete(iterator); + + return true; } FLAC__bool do_major_operation__remove(FLAC__Metadata_Chain *chain, const CommandLineOptions *options) diff --git a/src/metaflac/usage.c b/src/metaflac/usage.c index f9fcf0a5..603e3285 100644 --- a/src/metaflac/usage.c +++ b/src/metaflac/usage.c @@ -280,18 +280,14 @@ int long_usage(const char *message, ...) fprintf(out, " You may specify --data-format=binary to dump the raw binary form of each\n"); fprintf(out, " metadata block. Specify --data-format=binary-headerless to omit output of\n"); fprintf(out, " metadata block headers, including the id of APPLICATION metadata blocks.\n"); -#if 0 - fprintf(out, " The output can be read in using a subsequent call\n"); - fprintf(out, " to \"metaflac --append --from-file=...\"\n"); -#endif + fprintf(out, " The output can be read in using a subsequent call to\n"); + fprintf(out, " \"metaflac --append\"\n"); fprintf(out, "\n"); fprintf(out, " --application-data-format=hexdump|text\n"); fprintf(out, " If the application block you are displaying contains binary data but your\n"); fprintf(out, " --data-format=text, you can display a hex dump of the application data\n"); fprintf(out, " contents instead using --application-data-format=hexdump\n"); fprintf(out, "\n"); -#if 0 - /*@@@ not implemented yet */ fprintf(out, "--append\n"); fprintf(out, " Insert a metadata block from a file. The input file must be in the same\n"); fprintf(out, " format as generated with --list.\n"); @@ -302,6 +298,8 @@ int long_usage(const char *message, ...) fprintf(out, " of a block before the first STREAMINFO block. You may not --append another\n"); fprintf(out, " STREAMINFO block.\n"); fprintf(out, "\n"); +#if 0 + /*@@@ not implemented yet */ fprintf(out, " --from-file=filename\n"); fprintf(out, " Mandatory 'option' to specify the input file containing the block contents.\n"); fprintf(out, "\n"); -- cgit v1.2.3 From 21bf406fdab9d1e1bc0e4e42d2c62b1adcc79a4e Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Thu, 16 Feb 2023 09:32:58 +0100 Subject: Add checks so metaflac --append doesn't create invalid files Checks are added that no streaminfo or seektable blocks can be added, and no vorbis comment block is one already exists --- src/metaflac/operations.c | 52 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 45 insertions(+), 7 deletions(-) diff --git a/src/metaflac/operations.c b/src/metaflac/operations.c index e29311b5..1a8bdb25 100644 --- a/src/metaflac/operations.c +++ b/src/metaflac/operations.c @@ -217,7 +217,8 @@ FLAC__bool do_major_operation__append(FLAC__Metadata_Chain *chain, const Command FLAC__byte *buffer; FLAC__uint32 buffer_size, num_objects = 0, i, append_after = UINT32_MAX; FLAC__StreamMetadata *object; - FLAC__Metadata_Iterator *iterator; + FLAC__Metadata_Iterator *iterator = 0; + FLAC__bool has_vorbiscomment = false; /* First, find out after which block appending should take place */ for(i = 0; i < options->args.num_arguments; i++) { @@ -237,6 +238,17 @@ FLAC__bool do_major_operation__append(FLAC__Metadata_Chain *chain, const Command FLAC__metadata_iterator_init(iterator, chain); + /* Find out whether there is already a vorbis comment block present */ + do { + FLAC__MetadataType type = FLAC__metadata_iterator_get_block_type(iterator); + if(type == FLAC__METADATA_TYPE_VORBIS_COMMENT) + has_vorbiscomment = true; + } + while(FLAC__metadata_iterator_next(iterator)); + + /* Reset iterator */ + FLAC__metadata_iterator_init(iterator, chain); + /* Go to requested block */ for(i = 0; i < append_after; i++) { if(!FLAC__metadata_iterator_next(iterator)) @@ -250,32 +262,58 @@ FLAC__bool do_major_operation__append(FLAC__Metadata_Chain *chain, const Command buffer = safe_malloc_(buffer_size + FLAC__STREAM_METADATA_HEADER_LENGTH); memcpy(buffer, header, FLAC__STREAM_METADATA_HEADER_LENGTH); + num_objects++; + if(fread(buffer+FLAC__STREAM_METADATA_HEADER_LENGTH, 1, buffer_size, stdin) < buffer_size) { - flac_fprintf(stderr, "ERROR: couldn't read metadata block #%u from stdin\n",(num_objects+1)); + flac_fprintf(stderr, "ERROR: couldn't read metadata block #%u from stdin\n",(num_objects)); free(buffer); break; } if((object = FLAC__metadata_object_set_raw(buffer, buffer_size + FLAC__STREAM_METADATA_HEADER_LENGTH)) == NULL) { - flac_fprintf(stderr, "ERROR: couldn't parse supplied metadata block #%u\n",(num_objects+1)); + flac_fprintf(stderr, "ERROR: couldn't parse supplied metadata block #%u\n",(num_objects)); free(buffer); break; } free(buffer); + if(has_vorbiscomment && object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT) { + flac_fprintf(stderr, "ERROR: can't add another vorbis comment block to file, it already has one\n"); + FLAC__metadata_object_delete(object); + break; + } + + + if(object->type == FLAC__METADATA_TYPE_STREAMINFO) { + flac_fprintf(stderr, "ERROR: can't add streaminfo to file\n"); + FLAC__metadata_object_delete(object); + break; + } + + if(object->type == FLAC__METADATA_TYPE_SEEKTABLE) { + flac_fprintf(stderr, "ERROR: can't add seektable to file, please use --add-seekpoint instead\n"); + FLAC__metadata_object_delete(object); + break; + } + if(!FLAC__metadata_iterator_insert_block_after(iterator, object)) { - flac_fprintf(stderr, "ERROR: couldn't add supplied metadata block #%u to file\n",(num_objects+1)); + flac_fprintf(stderr, "ERROR: couldn't add supplied metadata block #%u to file\n",(num_objects)); FLAC__metadata_object_delete(object); - FLAC__metadata_iterator_delete(iterator); break; } - num_objects++; + /* Now check whether what type of block was added */ + { + FLAC__MetadataType type = FLAC__metadata_iterator_get_block_type(iterator); + if(type == FLAC__METADATA_TYPE_VORBIS_COMMENT) + has_vorbiscomment = true; + } } if(num_objects == 0) flac_fprintf(stderr, "ERROR: unable to find a metadata block in the supplied input\n"); - FLAC__metadata_iterator_delete(iterator); + if(iterator != 0) + FLAC__metadata_iterator_delete(iterator); return true; } -- cgit v1.2.3 From 0b3d86ebc35146243d352e000a41d82ee277ff59 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Fri, 17 Feb 2023 07:29:26 +0100 Subject: Check is_last flags on writing a chain --- src/libFLAC/metadata_iterators.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/libFLAC/metadata_iterators.c b/src/libFLAC/metadata_iterators.c index ffcd5c35..7adb45a5 100644 --- a/src/libFLAC/metadata_iterators.c +++ b/src/libFLAC/metadata_iterators.c @@ -1142,6 +1142,12 @@ static FLAC__bool chain_merge_adjacent_padding_(FLAC__Metadata_Chain *chain, FLA static FLAC__off_t chain_prepare_for_write_(FLAC__Metadata_Chain *chain, FLAC__bool use_padding) { FLAC__off_t current_length = chain_calculate_length_(chain); + FLAC__Metadata_Node * i; + + /* Check all is_last settings on the blocks */ + for(i = chain->head; i->next != NULL; i = i->next) + i->data->is_last = 0; + chain->tail->data->is_last = 1; if(use_padding) { /* if the metadata shrank and the last block is padding, we just extend the last padding block */ -- cgit v1.2.3 From 436a3577dc2b87d26c2da1ec2377567c3a50d1ea Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Thu, 16 Feb 2023 14:07:04 +0100 Subject: Add tests for metaflac --append --- src/metaflac/operations.c | 21 ++++--- test/metaflac-test-files/Makefile.am | 4 +- test/metaflac-test-files/case66-expect.meta | 62 +++++++++++++++++++ test/metaflac-test-files/case67-expect.meta | 95 +++++++++++++++++++++++++++++ test/test_metaflac.sh | 63 +++++++++++++++++++ 5 files changed, 236 insertions(+), 9 deletions(-) create mode 100644 test/metaflac-test-files/case66-expect.meta create mode 100644 test/metaflac-test-files/case67-expect.meta diff --git a/src/metaflac/operations.c b/src/metaflac/operations.c index 1a8bdb25..6766004f 100644 --- a/src/metaflac/operations.c +++ b/src/metaflac/operations.c @@ -267,39 +267,45 @@ FLAC__bool do_major_operation__append(FLAC__Metadata_Chain *chain, const Command if(fread(buffer+FLAC__STREAM_METADATA_HEADER_LENGTH, 1, buffer_size, stdin) < buffer_size) { flac_fprintf(stderr, "ERROR: couldn't read metadata block #%u from stdin\n",(num_objects)); free(buffer); - break; + FLAC__metadata_iterator_delete(iterator); + return false; } if((object = FLAC__metadata_object_set_raw(buffer, buffer_size + FLAC__STREAM_METADATA_HEADER_LENGTH)) == NULL) { flac_fprintf(stderr, "ERROR: couldn't parse supplied metadata block #%u\n",(num_objects)); free(buffer); - break; + FLAC__metadata_iterator_delete(iterator); + return false; } free(buffer); if(has_vorbiscomment && object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT) { flac_fprintf(stderr, "ERROR: can't add another vorbis comment block to file, it already has one\n"); FLAC__metadata_object_delete(object); - break; + FLAC__metadata_iterator_delete(iterator); + return false; } if(object->type == FLAC__METADATA_TYPE_STREAMINFO) { flac_fprintf(stderr, "ERROR: can't add streaminfo to file\n"); FLAC__metadata_object_delete(object); - break; + FLAC__metadata_iterator_delete(iterator); + return false; } if(object->type == FLAC__METADATA_TYPE_SEEKTABLE) { flac_fprintf(stderr, "ERROR: can't add seektable to file, please use --add-seekpoint instead\n"); FLAC__metadata_object_delete(object); - break; + FLAC__metadata_iterator_delete(iterator); + return false; } if(!FLAC__metadata_iterator_insert_block_after(iterator, object)) { flac_fprintf(stderr, "ERROR: couldn't add supplied metadata block #%u to file\n",(num_objects)); FLAC__metadata_object_delete(object); - break; + FLAC__metadata_iterator_delete(iterator); + return false; } /* Now check whether what type of block was added */ { @@ -312,8 +318,7 @@ FLAC__bool do_major_operation__append(FLAC__Metadata_Chain *chain, const Command if(num_objects == 0) flac_fprintf(stderr, "ERROR: unable to find a metadata block in the supplied input\n"); - if(iterator != 0) - FLAC__metadata_iterator_delete(iterator); + FLAC__metadata_iterator_delete(iterator); return true; } diff --git a/test/metaflac-test-files/Makefile.am b/test/metaflac-test-files/Makefile.am index 11134c01..675e3b56 100644 --- a/test/metaflac-test-files/Makefile.am +++ b/test/metaflac-test-files/Makefile.am @@ -82,7 +82,9 @@ EXTRA_DIST = \ case62-expect.meta \ case63-expect.meta \ case64-expect.meta \ - case65-expect.meta + case65-expect.meta \ + case66-expect.meta \ + case67-expect.meta clean-local: -rm -f out.* diff --git a/test/metaflac-test-files/case66-expect.meta b/test/metaflac-test-files/case66-expect.meta new file mode 100644 index 00000000..9345b158 --- /dev/null +++ b/test/metaflac-test-files/case66-expect.meta @@ -0,0 +1,62 @@ +METADATA block #0 + type: 0 (STREAMINFO) + is last: false + length: 34 + minimum blocksize: 1152 samples + maximum blocksize: 1152 samples + minimum framesize: 11 bytes + maximum framesize: 11 bytes + sample_rate: 44100 Hz + channels: 1 + bits-per-sample: 8 + total samples: 1 + MD5 signature: 8d39dd7eef115ea6975446ef4082951f +METADATA block #1 + type: 3 (SEEKTABLE) + is last: false + length: 18 + seek points: 1 + point 0: sample_number=0, stream_offset=0, frame_samples=1 +METADATA block #2 + type: 4 (VORBIS_COMMENT) + is last: false + length: 46 + vendor string: reference libFLAC 1.0.5_beta2 20030114 + comments: 0 +METADATA block #3 + type: 126 (UNKNOWN) + is last: false + length: 4 + data contents: + 00000000: AA 55 A5 5A 00 00 00 00 00 00 00 00 00 00 00 00 .U.Z +METADATA block #4 + type: 5 (CUESHEET) + is last: false + length: 480 + media catalog number: + lead-in: 88200 + is CD: true + number of tracks: 2 + track[0] + offset: 0 + number: 1 + ISRC: + type: AUDIO + pre-emphasis: false + number of index points: 1 + index[0] + offset: 0 + number: 1 + track[1] + offset: 1 + number: 170 (LEAD-OUT) +METADATA block #5 + type: 2 (APPLICATION) + is last: false + length: 12 + application ID: 61626364 + data contents: +calfflacMETADATA block #6 + type: 1 (PADDING) + is last: true + length: 12 diff --git a/test/metaflac-test-files/case67-expect.meta b/test/metaflac-test-files/case67-expect.meta new file mode 100644 index 00000000..3f6f2179 --- /dev/null +++ b/test/metaflac-test-files/case67-expect.meta @@ -0,0 +1,95 @@ +METADATA block #0 + type: 0 (STREAMINFO) + is last: false + length: 34 + minimum blocksize: 1152 samples + maximum blocksize: 1152 samples + minimum framesize: 11 bytes + maximum framesize: 11 bytes + sample_rate: 44100 Hz + channels: 1 + bits-per-sample: 8 + total samples: 1 + MD5 signature: 8d39dd7eef115ea6975446ef4082951f +METADATA block #1 + type: 126 (UNKNOWN) + is last: false + length: 4 + data contents: + 00000000: AA 55 A5 5A 00 00 00 00 00 00 00 00 00 00 00 00 .U.Z +METADATA block #2 + type: 5 (CUESHEET) + is last: false + length: 480 + media catalog number: + lead-in: 88200 + is CD: true + number of tracks: 2 + track[0] + offset: 0 + number: 1 + ISRC: + type: AUDIO + pre-emphasis: false + number of index points: 1 + index[0] + offset: 0 + number: 1 + track[1] + offset: 1 + number: 170 (LEAD-OUT) +METADATA block #3 + type: 2 (APPLICATION) + is last: false + length: 12 + application ID: 61626364 + data contents: +calfflacMETADATA block #4 + type: 3 (SEEKTABLE) + is last: false + length: 18 + seek points: 1 + point 0: sample_number=0, stream_offset=0, frame_samples=1 +METADATA block #5 + type: 4 (VORBIS_COMMENT) + is last: false + length: 46 + vendor string: reference libFLAC 1.0.5_beta2 20030114 + comments: 0 +METADATA block #6 + type: 126 (UNKNOWN) + is last: false + length: 4 + data contents: + 00000000: AA 55 A5 5A 00 00 00 00 00 00 00 00 00 00 00 00 .U.Z +METADATA block #7 + type: 5 (CUESHEET) + is last: false + length: 480 + media catalog number: + lead-in: 88200 + is CD: true + number of tracks: 2 + track[0] + offset: 0 + number: 1 + ISRC: + type: AUDIO + pre-emphasis: false + number of index points: 1 + index[0] + offset: 0 + number: 1 + track[1] + offset: 1 + number: 170 (LEAD-OUT) +METADATA block #8 + type: 2 (APPLICATION) + is last: false + length: 12 + application ID: 61626364 + data contents: +calfflacMETADATA block #9 + type: 1 (PADDING) + is last: true + length: 28 diff --git a/test/test_metaflac.sh b/test/test_metaflac.sh index 7c71f240..e28c090d 100755 --- a/test/test_metaflac.sh +++ b/test/test_metaflac.sh @@ -69,6 +69,17 @@ run_metaflac_silent () fi } +run_metaflac_to_metaflac_silent () +{ + if [ "$FLAC__TEST_WITH_VALGRIND" = yes ] ; then + echo "valgrind --leak-check=yes --show-reachable=yes --num-callers=50 metaflac $*" >>test_metaflac.valgrind.log + valgrind --leak-check=yes --show-reachable=yes --num-callers=50 --log-fd=4 metaflac${EXE} $* 2>/dev/null 4>>test_metaflac.valgrind.log + else + metaflac${EXE} $1 | metaflac${EXE} $2 2>/dev/null + fi +} + + check_flac () { run_flac --silent --test $flacfile || die "ERROR in $flacfile" 1>&2 @@ -399,4 +410,56 @@ run_metaflac --remove --block-type=VORBIS_COMMENT --dont-use-padding $flacfile cmp $flacfile ${top_srcdir}/test/metaflac.flac.ok || die "ERROR, $flacfile and metaflac.flac.ok differ" echo OK +cp -p ${top_srcdir}/test/metaflac.flac.in $flacfile + +flacfile2=metaflac2.flac +cp $flacfile $flacfile2 +run_metaflac --remove-all --dont-use-padding $flacfile + +echo $ECHO_N "Appending a streaminfo metadata block... " $ECHO_C +if run_metaflac_to_metaflac_silent "--list --data-format=binary $flacfile2" "--append $flacfile" ; then + die "ERROR: it should have failed but didn't" +else + echo "OK, it failed as it should" +fi + +echo $ECHO_N "Appending a seektable metadata block... " $ECHO_C +if run_metaflac_to_metaflac_silent "--list --data-format=binary --except-block-type=STREAMINFO $flacfile2" "--append $flacfile" ; then + die "ERROR: it should have failed but didn't" +else + echo "OK, it failed as it should" +fi + +run_metaflac --add-seekpoint=0 $flacfile + +echo $ECHO_N "Appending a vorbis comment metadata block... " $ECHO_C +if run_metaflac_to_metaflac_silent "--list --data-format=binary --block-type=VORBIS_COMMENT $flacfile2" "--append $flacfile" ; then + echo "OK" +else + die "ERROR, couldn't add vorbis comment metadata block" +fi + +echo $ECHO_N "Appending another vorbis comment metadata block... " $ECHO_C +if run_metaflac_to_metaflac_silent "--list --data-format=binary --block-type=VORBIS_COMMENT $flacfile2" "--append $flacfile" ; then + die "ERROR: it should have failed but didn't" +else + echo "OK, it failed as it should" +fi + +if run_metaflac_to_metaflac_silent "--list --data-format=binary --except-block-type=STREAMINFO,SEEKTABLE,VORBIS_COMMENT $flacfile2" "--append $flacfile" ; then + : +else + die "ERROR, couldn't add vorbis comment metadata block" +fi + +metaflac_test_binary case66 "--append" "--list" + +if run_metaflac_to_metaflac_silent "--list --data-format=binary --except-block-type=STREAMINFO,SEEKTABLE,VORBIS_COMMENT $flacfile2" "--append --block-number=0 $flacfile" ; then + : +else + die "ERROR, couldn't add vorbis comment metadata block" +fi + +metaflac_test_binary case67 "--append --block-number=0" "--list" + rm -f metaflac-test-files/out.meta metaflac-test-files/out1.meta -- cgit v1.2.3 From 6fa51a7acc8711ba44038740892b86ad9abfafd7 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Fri, 17 Feb 2023 13:31:55 +0100 Subject: Fix error of metaflac --append testing, add troubleshooting --- .github/workflows/action.yml | 4 +++- test/test_metaflac.sh | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index 1dc51157..69535243 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -196,4 +196,6 @@ jobs: if: failure() with: name: flac-${{ github.sha }}-${{ github.run_id }}-logs - path: ./**/*.log + path: | + ./**/*.log + ./**/out*.meta diff --git a/test/test_metaflac.sh b/test/test_metaflac.sh index e28c090d..08630807 100755 --- a/test/test_metaflac.sh +++ b/test/test_metaflac.sh @@ -30,7 +30,7 @@ if echo a | (grep -E '(a|b)') >/dev/null 2>&1 fi testdir="metaflac-test-files" -flacfile="metaflac.flac" +flacfile="metaflac1.flac" flac${EXE} --help 1>/dev/null 2>/dev/null || die "ERROR can't find flac executable" metaflac${EXE} --help 1>/dev/null 2>/dev/null || die "ERROR can't find metaflac executable" @@ -403,6 +403,7 @@ run_flac ${top_srcdir}/test/foreign-metadata-test-files/AIFF-ID3.aiff --keep-for metaflac_test_binary case65 "--data-format=binary" "--list --data-format=binary-headerless --block-type=APPLICATION:aiff" # UNKNOWN blocks +flacfile=metaflac2.flac echo $ECHO_N "Testing FLAC file with unknown metadata... " $ECHO_C cp -p ${top_srcdir}/test/metaflac.flac.in $flacfile # remove the VORBIS_COMMENT block so vendor string changes don't interfere with the comparison: @@ -410,9 +411,10 @@ run_metaflac --remove --block-type=VORBIS_COMMENT --dont-use-padding $flacfile cmp $flacfile ${top_srcdir}/test/metaflac.flac.ok || die "ERROR, $flacfile and metaflac.flac.ok differ" echo OK +flacfile=metaflac3.flac cp -p ${top_srcdir}/test/metaflac.flac.in $flacfile -flacfile2=metaflac2.flac +flacfile2=metaflac4.flac cp $flacfile $flacfile2 run_metaflac --remove-all --dont-use-padding $flacfile -- cgit v1.2.3 From c10b0595887743ffd17042d35741ea71b37c1600 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Fri, 17 Feb 2023 13:56:48 +0100 Subject: Limit hexdump characters to what is allowed in UTF-8 CI tests failed on MacOS printf using a non-UTF8 locale, printing characters for bytes values above 127. To have a consistent interface, only print characters with a byte value lower than 128. --- src/metaflac/utils.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/metaflac/utils.c b/src/metaflac/utils.c index 236fde4e..d819097e 100644 --- a/src/metaflac/utils.c +++ b/src/metaflac/utils.c @@ -87,6 +87,7 @@ void local_strcat(char **dest, const char *source) static inline int local_isprint(int c) { if (c < 32) return 0; + if (c > 127) return 0; return isprint(c); } -- cgit v1.2.3 From 6633d2f9bfdba89e646d2169f5d8c1e9b168d972 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Mon, 20 Feb 2023 08:12:48 +0100 Subject: Set stdin/stdout to binary on Windows for binary input/output Also fix tests on Windows --- src/metaflac/operations.c | 16 ++++++++++++++++ test/test_metaflac.sh | 17 ++++++++++++++--- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/src/metaflac/operations.c b/src/metaflac/operations.c index 6766004f..631fd21b 100644 --- a/src/metaflac/operations.c +++ b/src/metaflac/operations.c @@ -255,6 +255,10 @@ FLAC__bool do_major_operation__append(FLAC__Metadata_Chain *chain, const Command break; } +#ifdef _WIN32 + _setmode(fileno(stdin),_O_BINARY); +#endif + /* Read header from stdin */ while(fread(header, 1, FLAC__STREAM_METADATA_HEADER_LENGTH, stdin) == FLAC__STREAM_METADATA_HEADER_LENGTH) { @@ -315,6 +319,10 @@ FLAC__bool do_major_operation__append(FLAC__Metadata_Chain *chain, const Command } } +#ifdef _WIN32 + _setmode(fileno(stdin),_O_TEXT); +#endif + if(num_objects == 0) flac_fprintf(stderr, "ERROR: unable to find a metadata block in the supplied input\n"); @@ -795,10 +803,18 @@ void write_metadata(const char *filename, FLAC__StreamMetadata *block, unsigned void write_metadata_binary(FLAC__StreamMetadata *block, FLAC__byte *block_raw, FLAC__bool headerless) { +#ifdef _WIN32 + fflush(stdout); + _setmode(fileno(stdout),_O_BINARY); +#endif if(!headerless) local_fwrite(block_raw, 1, block->length+FLAC__STREAM_METADATA_HEADER_LENGTH, stdout); else if(block->type == FLAC__METADATA_TYPE_APPLICATION && block->length > 3) local_fwrite(block_raw+FLAC__STREAM_METADATA_HEADER_LENGTH+4, 1, block->length-4, stdout); else local_fwrite(block_raw+FLAC__STREAM_METADATA_HEADER_LENGTH, 1, block->length, stdout); +#ifdef _WIN32 + fflush(stdout); + _setmode(fileno(stdout),_O_TEXT); +#endif } diff --git a/test/test_metaflac.sh b/test/test_metaflac.sh index 08630807..42e38eb1 100755 --- a/test/test_metaflac.sh +++ b/test/test_metaflac.sh @@ -124,6 +124,18 @@ metaflac_test () echo OK } +metaflac_test_nofilter () +{ + case="$testdatadir/$1" + desc="$2" + args="$3" + expect="$case-expect.meta" + echo $ECHO_N "test $1: $desc... " $ECHO_C + run_metaflac $args $flacfile > $testdir/out.meta || die "ERROR running metaflac" + diff -w $expect $testdir/out.meta || die "ERROR: metadata does not match expected $expect" + echo OK +} + metaflac_test_binary () { case="$testdatadir/$1" @@ -133,7 +145,6 @@ metaflac_test_binary () echo $ECHO_N "test $1: $desc... " $ECHO_C run_metaflac $args $flacfile > $testdir/out.meta || die "ERROR running metaflac" cmp $expect $testdir/out.meta || die "ERROR: metadata does not match expected $expect" - # To blindly accept (and check later): cp -f $testdir/out.meta $expect echo OK } @@ -454,7 +465,7 @@ else die "ERROR, couldn't add vorbis comment metadata block" fi -metaflac_test_binary case66 "--append" "--list" +metaflac_test_nofilter case66 "--append" "--list" if run_metaflac_to_metaflac_silent "--list --data-format=binary --except-block-type=STREAMINFO,SEEKTABLE,VORBIS_COMMENT $flacfile2" "--append --block-number=0 $flacfile" ; then : @@ -462,6 +473,6 @@ else die "ERROR, couldn't add vorbis comment metadata block" fi -metaflac_test_binary case67 "--append --block-number=0" "--list" +metaflac_test_nofilter case67 "--append --block-number=0" "--list" rm -f metaflac-test-files/out.meta metaflac-test-files/out1.meta -- cgit v1.2.3 From 68f605bd281a37890ed696555a52c6180457164f Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Mon, 20 Mar 2023 19:21:23 +0100 Subject: Fix mistakes in _compute_best_predictor_limit_residual_intrin_* (#572) I made a few mistakes in these functions, adding instead of or-ing and xor-ing instead of or-ing. The issue linked below seems to relate to something completely different, but it is in fact a result of triggering these mistakes further down the line. Credit: Oss-Fuzz Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=57071 --- src/libFLAC/fixed_intrin_avx2.c | 20 ++++++++++---------- src/libFLAC/fixed_intrin_sse42.c | 20 ++++++++++---------- src/libFLAC/stream_encoder.c | 1 - 3 files changed, 20 insertions(+), 21 deletions(-) diff --git a/src/libFLAC/fixed_intrin_avx2.c b/src/libFLAC/fixed_intrin_avx2.c index 668e8d3e..e515e230 100644 --- a/src/libFLAC/fixed_intrin_avx2.c +++ b/src/libFLAC/fixed_intrin_avx2.c @@ -251,7 +251,7 @@ uint32_t FLAC__fixed_compute_best_predictor_limit_residual_intrin_avx2(const FLA tempB = _mm256_xor_si256(tempA, bitmask); tempB = _mm256_sub_epi64(tempB, bitmask); total_err0 = _mm256_add_epi64(total_err0,tempB); - shadow_err0 = _mm256_xor_si256(shadow_err0,tempB); + shadow_err0 = _mm256_or_si256(shadow_err0,tempB); tempB = _mm256_sub_epi64(tempA,prev_err0); prev_err0 = tempA; /* Next three intrinsics calculate tempA as abs of tempB */ @@ -259,7 +259,7 @@ uint32_t FLAC__fixed_compute_best_predictor_limit_residual_intrin_avx2(const FLA tempA = _mm256_xor_si256(tempB, bitmask); tempA = _mm256_sub_epi64(tempA, bitmask); total_err1 = _mm256_add_epi64(total_err1,tempA); - shadow_err1 = _mm256_xor_si256(shadow_err1,tempA); + shadow_err1 = _mm256_or_si256(shadow_err1,tempA); tempA = _mm256_sub_epi64(tempB,prev_err1); prev_err1 = tempB; /* Next three intrinsics calculate tempB as abs of tempA */ @@ -267,7 +267,7 @@ uint32_t FLAC__fixed_compute_best_predictor_limit_residual_intrin_avx2(const FLA tempB = _mm256_xor_si256(tempA, bitmask); tempB = _mm256_sub_epi64(tempB, bitmask); total_err2 = _mm256_add_epi64(total_err2,tempB); - shadow_err2 = _mm256_xor_si256(shadow_err2,tempB); + shadow_err2 = _mm256_or_si256(shadow_err2,tempB); tempB = _mm256_sub_epi64(tempA,prev_err2); prev_err2 = tempA; /* Next three intrinsics calculate tempA as abs of tempB */ @@ -275,7 +275,7 @@ uint32_t FLAC__fixed_compute_best_predictor_limit_residual_intrin_avx2(const FLA tempA = _mm256_xor_si256(tempB, bitmask); tempA = _mm256_sub_epi64(tempA, bitmask); total_err3 = _mm256_add_epi64(total_err3,tempA); - shadow_err3 = _mm256_xor_si256(shadow_err3,tempA); + shadow_err3 = _mm256_or_si256(shadow_err3,tempA); tempA = _mm256_sub_epi64(tempB,prev_err3); prev_err3 = tempB; /* Next three intrinsics calculate tempB as abs of tempA */ @@ -283,7 +283,7 @@ uint32_t FLAC__fixed_compute_best_predictor_limit_residual_intrin_avx2(const FLA tempB = _mm256_xor_si256(tempA, bitmask); tempB = _mm256_sub_epi64(tempB, bitmask); total_err4 = _mm256_add_epi64(total_err4,tempB); - shadow_err4 = _mm256_xor_si256(shadow_err4,tempB); + shadow_err4 = _mm256_or_si256(shadow_err4,tempB); } _mm256_storeu_si256((__m256i*)data_scalar,total_err0); total_error_0 += data_scalar[0] + data_scalar[1] + data_scalar[2] + data_scalar[3]; @@ -296,15 +296,15 @@ uint32_t FLAC__fixed_compute_best_predictor_limit_residual_intrin_avx2(const FLA _mm256_storeu_si256((__m256i*)data_scalar,total_err4); total_error_4 += data_scalar[0] + data_scalar[1] + data_scalar[2] + data_scalar[3]; _mm256_storeu_si256((__m256i*)data_scalar,shadow_err0); - shadow_error_0 += data_scalar[0] | data_scalar[1] | data_scalar[2] | data_scalar[3]; + shadow_error_0 |= data_scalar[0] | data_scalar[1] | data_scalar[2] | data_scalar[3]; _mm256_storeu_si256((__m256i*)data_scalar,shadow_err1); - shadow_error_1 += data_scalar[0] | data_scalar[1] | data_scalar[2] | data_scalar[3]; + shadow_error_1 |= data_scalar[0] | data_scalar[1] | data_scalar[2] | data_scalar[3]; _mm256_storeu_si256((__m256i*)data_scalar,shadow_err2); - shadow_error_2 += data_scalar[0] | data_scalar[1] | data_scalar[2] | data_scalar[3]; + shadow_error_2 |= data_scalar[0] | data_scalar[1] | data_scalar[2] | data_scalar[3]; _mm256_storeu_si256((__m256i*)data_scalar,shadow_err3); - shadow_error_3 += data_scalar[0] | data_scalar[1] | data_scalar[2] | data_scalar[3]; + shadow_error_3 |= data_scalar[0] | data_scalar[1] | data_scalar[2] | data_scalar[3]; _mm256_storeu_si256((__m256i*)data_scalar,shadow_err4); - shadow_error_4 += data_scalar[0] | data_scalar[1] | data_scalar[2] | data_scalar[3]; + shadow_error_4 |= data_scalar[0] | data_scalar[1] | data_scalar[2] | data_scalar[3]; /* Take care of remaining sample */ for(i = (data_len/4)*4; i < data_len_int; i++) { diff --git a/src/libFLAC/fixed_intrin_sse42.c b/src/libFLAC/fixed_intrin_sse42.c index 6be407e2..f20c7dd3 100644 --- a/src/libFLAC/fixed_intrin_sse42.c +++ b/src/libFLAC/fixed_intrin_sse42.c @@ -130,7 +130,7 @@ uint32_t FLAC__fixed_compute_best_predictor_limit_residual_intrin_sse42(const FL tempB = _mm_xor_si128(tempA, bitmask); tempB = _mm_sub_epi64(tempB, bitmask); total_err0 = _mm_add_epi64(total_err0,tempB); - shadow_err0 = _mm_xor_si128(shadow_err0,tempB); + shadow_err0 = _mm_or_si128(shadow_err0,tempB); tempB = _mm_sub_epi64(tempA,prev_err0); prev_err0 = tempA; /* Next three intrinsics calculate tempA as abs of tempB */ @@ -138,7 +138,7 @@ uint32_t FLAC__fixed_compute_best_predictor_limit_residual_intrin_sse42(const FL tempA = _mm_xor_si128(tempB, bitmask); tempA = _mm_sub_epi64(tempA, bitmask); total_err1 = _mm_add_epi64(total_err1,tempA); - shadow_err1 = _mm_xor_si128(shadow_err1,tempA); + shadow_err1 = _mm_or_si128(shadow_err1,tempA); tempA = _mm_sub_epi64(tempB,prev_err1); prev_err1 = tempB; /* Next three intrinsics calculate tempB as abs of tempA */ @@ -146,7 +146,7 @@ uint32_t FLAC__fixed_compute_best_predictor_limit_residual_intrin_sse42(const FL tempB = _mm_xor_si128(tempA, bitmask); tempB = _mm_sub_epi64(tempB, bitmask); total_err2 = _mm_add_epi64(total_err2,tempB); - shadow_err2 = _mm_xor_si128(shadow_err2,tempB); + shadow_err2 = _mm_or_si128(shadow_err2,tempB); tempB = _mm_sub_epi64(tempA,prev_err2); prev_err2 = tempA; /* Next three intrinsics calculate tempA as abs of tempB */ @@ -154,7 +154,7 @@ uint32_t FLAC__fixed_compute_best_predictor_limit_residual_intrin_sse42(const FL tempA = _mm_xor_si128(tempB, bitmask); tempA = _mm_sub_epi64(tempA, bitmask); total_err3 = _mm_add_epi64(total_err3,tempA); - shadow_err3 = _mm_xor_si128(shadow_err3,tempA); + shadow_err3 = _mm_or_si128(shadow_err3,tempA); tempA = _mm_sub_epi64(tempB,prev_err3); prev_err3 = tempB; /* Next three intrinsics calculate tempB as abs of tempA */ @@ -162,7 +162,7 @@ uint32_t FLAC__fixed_compute_best_predictor_limit_residual_intrin_sse42(const FL tempB = _mm_xor_si128(tempA, bitmask); tempB = _mm_sub_epi64(tempB, bitmask); total_err4 = _mm_add_epi64(total_err4,tempB); - shadow_err4 = _mm_xor_si128(shadow_err4,tempB); + shadow_err4 = _mm_or_si128(shadow_err4,tempB); } _mm_storeu_si128((__m128i*)data_scalar,total_err0); total_error_0 += data_scalar[0] + data_scalar[1]; @@ -175,15 +175,15 @@ uint32_t FLAC__fixed_compute_best_predictor_limit_residual_intrin_sse42(const FL _mm_storeu_si128((__m128i*)data_scalar,total_err4); total_error_4 += data_scalar[0] + data_scalar[1]; _mm_storeu_si128((__m128i*)data_scalar,shadow_err0); - shadow_error_0 += data_scalar[0] | data_scalar[1]; + shadow_error_0 |= data_scalar[0] | data_scalar[1]; _mm_storeu_si128((__m128i*)data_scalar,shadow_err1); - shadow_error_1 += data_scalar[0] | data_scalar[1]; + shadow_error_1 |= data_scalar[0] | data_scalar[1]; _mm_storeu_si128((__m128i*)data_scalar,shadow_err2); - shadow_error_2 += data_scalar[0] | data_scalar[1]; + shadow_error_2 |= data_scalar[0] | data_scalar[1]; _mm_storeu_si128((__m128i*)data_scalar,shadow_err3); - shadow_error_3 += data_scalar[0] | data_scalar[1]; + shadow_error_3 |= data_scalar[0] | data_scalar[1]; _mm_storeu_si128((__m128i*)data_scalar,shadow_err4); - shadow_error_4 += data_scalar[0] | data_scalar[1]; + shadow_error_4 |= data_scalar[0] | data_scalar[1]; /* Take care of remaining sample */ if(data_len_int % 2 > 0) { diff --git a/src/libFLAC/stream_encoder.c b/src/libFLAC/stream_encoder.c index 5a13637b..7ce1f1d7 100644 --- a/src/libFLAC/stream_encoder.c +++ b/src/libFLAC/stream_encoder.c @@ -1064,7 +1064,6 @@ static FLAC__StreamEncoderInitStatus init_stream_internal_( # ifdef FLAC__SSE4_2_SUPPORTED if (encoder->private_->cpuinfo.x86.sse42) { encoder->private_->local_fixed_compute_best_predictor_limit_residual = FLAC__fixed_compute_best_predictor_limit_residual_intrin_sse42; - } # endif # ifdef FLAC__AVX2_SUPPORTED -- cgit v1.2.3 From 75d596a23435b184910da5dc176bccb2c19301aa Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Mon, 27 Mar 2023 11:58:49 +0200 Subject: Only calculate mid-side signal when necessary (#567) The calculation of the mid-side signal components is moved, so this is only performed when necessary. This gives a speed up of about 2% for preset 1 on a representative sample --- src/libFLAC/stream_encoder.c | 145 +++++++++++++------------------------------ 1 file changed, 43 insertions(+), 102 deletions(-) diff --git a/src/libFLAC/stream_encoder.c b/src/libFLAC/stream_encoder.c index 7ce1f1d7..0089753a 100644 --- a/src/libFLAC/stream_encoder.c +++ b/src/libFLAC/stream_encoder.c @@ -2248,7 +2248,7 @@ FLAC_API FLAC__bool FLAC__stream_encoder_get_limit_min_bitrate(const FLAC__Strea FLAC_API FLAC__bool FLAC__stream_encoder_process(FLAC__StreamEncoder *encoder, const FLAC__int32 * const buffer[], uint32_t samples) { uint32_t i, j = 0, k = 0, channel; - const uint32_t channels = encoder->protected_->channels, blocksize = encoder->protected_->blocksize, bps = encoder->protected_->bits_per_sample; + const uint32_t channels = encoder->protected_->channels, blocksize = encoder->protected_->blocksize; const FLAC__int32 sample_max = INT32_MAX >> (32 - encoder->protected_->bits_per_sample); const FLAC__int32 sample_min = INT32_MIN >> (32 - encoder->protected_->bits_per_sample); @@ -2277,24 +2277,7 @@ FLAC_API FLAC__bool FLAC__stream_encoder_process(FLAC__StreamEncoder *encoder, c } memcpy(&encoder->private_->integer_signal[channel][encoder->private_->current_sample_number], &buffer[channel][j], sizeof(buffer[channel][0]) * n); } - - if(encoder->protected_->do_mid_side_stereo) { - FLAC__ASSERT(channels == 2); - /* "i <= blocksize" to overread 1 sample; see comment in OVERREAD_ decl */ - if(bps < 32) - for(i = encoder->private_->current_sample_number; i <= blocksize && j < samples; i++, j++) { - encoder->private_->integer_signal_mid_side[1][i] = buffer[0][j] - buffer[1][j]; - encoder->private_->integer_signal_mid_side[0][i] = (buffer[0][j] + buffer[1][j]) >> 1; /* NOTE: not the same as 'mid = (buffer[0][j] + buffer[1][j]) / 2' ! */ - } - else - for(i = encoder->private_->current_sample_number; i <= blocksize && j < samples; i++, j++) { - encoder->private_->integer_signal_33bit_side[i] = (FLAC__int64)buffer[0][j] - (FLAC__int64)buffer[1][j]; - encoder->private_->integer_signal_mid_side[0][i] = ((FLAC__int64)buffer[0][j] + (FLAC__int64)buffer[1][j]) >> 1; /* NOTE: not the same as 'mid = (buffer[0][j] + buffer[1][j]) / 2' ! */ - } - } - else - j += n; - + j += n; encoder->private_->current_sample_number += n; /* we only process if we have a full block + 1 extra sample; final block is always handled by FLAC__stream_encoder_finish() */ @@ -2306,13 +2289,6 @@ FLAC_API FLAC__bool FLAC__stream_encoder_process(FLAC__StreamEncoder *encoder, c /* move unprocessed overread samples to beginnings of arrays */ for(channel = 0; channel < channels; channel++) encoder->private_->integer_signal[channel][0] = encoder->private_->integer_signal[channel][blocksize]; - if(encoder->protected_->do_mid_side_stereo) { - encoder->private_->integer_signal_mid_side[0][0] = encoder->private_->integer_signal_mid_side[0][blocksize]; - if(bps < 32) - encoder->private_->integer_signal_mid_side[1][0] = encoder->private_->integer_signal_mid_side[1][blocksize]; - else - encoder->private_->integer_signal_33bit_side[0] = encoder->private_->integer_signal_33bit_side[blocksize]; - } encoder->private_->current_sample_number = 1; } } while(j < samples); @@ -2323,7 +2299,7 @@ FLAC_API FLAC__bool FLAC__stream_encoder_process(FLAC__StreamEncoder *encoder, c FLAC_API FLAC__bool FLAC__stream_encoder_process_interleaved(FLAC__StreamEncoder *encoder, const FLAC__int32 buffer[], uint32_t samples) { uint32_t i, j, k, channel; - const uint32_t channels = encoder->protected_->channels, blocksize = encoder->protected_->blocksize, bps = encoder->protected_->bits_per_sample; + const uint32_t channels = encoder->protected_->channels, blocksize = encoder->protected_->blocksize; const FLAC__int32 sample_max = INT32_MAX >> (32 - encoder->protected_->bits_per_sample); const FLAC__int32 sample_min = INT32_MIN >> (32 - encoder->protected_->bits_per_sample); @@ -2335,87 +2311,33 @@ FLAC_API FLAC__bool FLAC__stream_encoder_process_interleaved(FLAC__StreamEncoder return false; j = k = 0; - /* - * we have several flavors of the same basic loop, optimized for - * different conditions: - */ - if(encoder->protected_->do_mid_side_stereo && channels == 2) { - /* - * stereo coding: unroll channel loop - */ - do { - if(encoder->protected_->verify) - append_to_verify_fifo_interleaved_(&encoder->private_->verify.input_fifo, buffer, j, channels, flac_min(blocksize+OVERREAD_-encoder->private_->current_sample_number, samples-j)); + do { + if(encoder->protected_->verify) + append_to_verify_fifo_interleaved_(&encoder->private_->verify.input_fifo, buffer, j, channels, flac_min(blocksize+OVERREAD_-encoder->private_->current_sample_number, samples-j)); /* "i <= blocksize" to overread 1 sample; see comment in OVERREAD_ decl */ - for(i = encoder->private_->current_sample_number; i <= blocksize && j < samples; i++, j++) { - if(buffer[k] < sample_min || buffer[k] > sample_max || - buffer[k+1] < sample_min || buffer[k+1] > sample_max){ + for(i = encoder->private_->current_sample_number; i <= blocksize && j < samples; i++, j++) { + for(channel = 0; channel < channels; channel++){ + if(buffer[k] < sample_min || buffer[k] > sample_max){ encoder->protected_->state = FLAC__STREAM_ENCODER_CLIENT_ERROR; return false; } - encoder->private_->integer_signal[0][i] = buffer[k++]; - encoder->private_->integer_signal[1][i] = buffer[k++]; - if(bps < 32){ - encoder->private_->integer_signal_mid_side[1][i] = encoder->private_->integer_signal[0][i] - encoder->private_->integer_signal[1][i]; - encoder->private_->integer_signal_mid_side[0][i] = (encoder->private_->integer_signal[0][i] + encoder->private_->integer_signal[1][i]) >> 1; - } - else { - encoder->private_->integer_signal_33bit_side[i] = (FLAC__int64)encoder->private_->integer_signal[0][i] - (FLAC__int64)encoder->private_->integer_signal[1][i]; - encoder->private_->integer_signal_mid_side[0][i] = ((FLAC__int64)encoder->private_->integer_signal[0][i] + (FLAC__int64)encoder->private_->integer_signal[1][i]) >> 1; - } - } - encoder->private_->current_sample_number = i; - /* we only process if we have a full block + 1 extra sample; final block is always handled by FLAC__stream_encoder_finish() */ - if(i > blocksize) { - if(!process_frame_(encoder, /*is_last_block=*/false)) - return false; - /* move unprocessed overread samples to beginnings of arrays */ - FLAC__ASSERT(i == blocksize+OVERREAD_); - FLAC__ASSERT(OVERREAD_ == 1); /* assert we only overread 1 sample which simplifies the rest of the code below */ - encoder->private_->integer_signal[0][0] = encoder->private_->integer_signal[0][blocksize]; - encoder->private_->integer_signal[1][0] = encoder->private_->integer_signal[1][blocksize]; - encoder->private_->integer_signal_mid_side[0][0] = encoder->private_->integer_signal_mid_side[0][blocksize]; - if(bps < 32) - encoder->private_->integer_signal_mid_side[1][0] = encoder->private_->integer_signal_mid_side[1][blocksize]; - else - encoder->private_->integer_signal_33bit_side[0] = encoder->private_->integer_signal_33bit_side[blocksize]; - encoder->private_->current_sample_number = 1; - } - } while(j < samples); - } - else { - /* - * independent channel coding: buffer each channel in inner loop - */ - do { - if(encoder->protected_->verify) - append_to_verify_fifo_interleaved_(&encoder->private_->verify.input_fifo, buffer, j, channels, flac_min(blocksize+OVERREAD_-encoder->private_->current_sample_number, samples-j)); - - /* "i <= blocksize" to overread 1 sample; see comment in OVERREAD_ decl */ - for(i = encoder->private_->current_sample_number; i <= blocksize && j < samples; i++, j++) { - for(channel = 0; channel < channels; channel++){ - if(buffer[k] < sample_min || buffer[k] > sample_max){ - encoder->protected_->state = FLAC__STREAM_ENCODER_CLIENT_ERROR; - return false; - } - encoder->private_->integer_signal[channel][i] = buffer[k++]; - } + encoder->private_->integer_signal[channel][i] = buffer[k++]; } - encoder->private_->current_sample_number = i; - /* we only process if we have a full block + 1 extra sample; final block is always handled by FLAC__stream_encoder_finish() */ - if(i > blocksize) { - if(!process_frame_(encoder, /*is_last_block=*/false)) - return false; - /* move unprocessed overread samples to beginnings of arrays */ - FLAC__ASSERT(i == blocksize+OVERREAD_); - FLAC__ASSERT(OVERREAD_ == 1); /* assert we only overread 1 sample which simplifies the rest of the code below */ - for(channel = 0; channel < channels; channel++) - encoder->private_->integer_signal[channel][0] = encoder->private_->integer_signal[channel][blocksize]; - encoder->private_->current_sample_number = 1; - } - } while(j < samples); - } + } + encoder->private_->current_sample_number = i; + /* we only process if we have a full block + 1 extra sample; final block is always handled by FLAC__stream_encoder_finish() */ + if(i > blocksize) { + if(!process_frame_(encoder, /*is_last_block=*/false)) + return false; + /* move unprocessed overread samples to beginnings of arrays */ + FLAC__ASSERT(i == blocksize+OVERREAD_); + FLAC__ASSERT(OVERREAD_ == 1); /* assert we only overread 1 sample which simplifies the rest of the code below */ + for(channel = 0; channel < channels; channel++) + encoder->private_->integer_signal[channel][0] = encoder->private_->integer_signal[channel][blocksize]; + encoder->private_->current_sample_number = 1; + } + } while(j < samples); return true; } @@ -3279,6 +3201,25 @@ FLAC__bool process_subframes_(FLAC__StreamEncoder *encoder) FLAC__ASSERT(do_independent || do_mid_side); + /* + * Prepare mid-side signals if applicable + */ + if(do_mid_side) { + uint32_t i; + FLAC__ASSERT(encoder->protected_->channels == 2); + if(encoder->protected_->bits_per_sample < 32) + for(i = 0; i < encoder->protected_->blocksize; i++) { + encoder->private_->integer_signal_mid_side[1][i] = encoder->private_->integer_signal[0][i] - encoder->private_->integer_signal[1][i]; + encoder->private_->integer_signal_mid_side[0][i] = (encoder->private_->integer_signal[0][i] + encoder->private_->integer_signal[1][i]) >> 1; /* NOTE: not the same as 'mid = (signal[0][j] + signal[1][j]) / 2' ! */ + } + else + for(i = 0; i <= encoder->protected_->blocksize; i++) { + encoder->private_->integer_signal_33bit_side[i] = (FLAC__int64)encoder->private_->integer_signal[0][i] - (FLAC__int64)encoder->private_->integer_signal[1][i]; + encoder->private_->integer_signal_mid_side[0][i] = ((FLAC__int64)encoder->private_->integer_signal[0][i] + (FLAC__int64)encoder->private_->integer_signal[1][i]) >> 1; /* NOTE: not the same as 'mid = (signal[0][j] + signal[1][j]) / 2' ! */ + } + } + + /* * Check for wasted bits; set effective bps for each subframe */ -- cgit v1.2.3 From 00cb41ee034fd4c5a21bf4167ee9363cc4ab39e2 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Wed, 8 Mar 2023 08:42:02 +0100 Subject: Add use of x86 BMI2 to bitreader_read_rice_signed_block --- include/share/private.h | 2 +- src/libFLAC/Makefile.am | 1 + src/libFLAC/bitreader.c | 149 +-------------------- src/libFLAC/cpu.c | 3 + .../bitreader_read_rice_signed_block.c | 143 ++++++++++++++++++++ src/libFLAC/include/private/bitreader.h | 4 + src/libFLAC/include/private/cpu.h | 3 + src/libFLAC/stream_decoder.c | 14 +- 8 files changed, 175 insertions(+), 144 deletions(-) create mode 100644 src/libFLAC/deduplication/bitreader_read_rice_signed_block.c diff --git a/include/share/private.h b/include/share/private.h index 653c415d..b4312756 100644 --- a/include/share/private.h +++ b/include/share/private.h @@ -36,7 +36,7 @@ * Unpublished debug routines from libFLAC. This should not be used from any * client code other than code shipped with the FLAC sources. */ -FLAC_API FLAC__bool FLAC__stream_encoder_disable_instruction_set(FLAC__StreamEncoder *encoder, FLAC__bool value); +FLAC_API FLAC__bool FLAC__stream_encoder_disable_instruction_set(FLAC__StreamEncoder *encoder, int value); FLAC_API FLAC__bool FLAC__stream_encoder_disable_constant_subframes(FLAC__StreamEncoder *encoder, FLAC__bool value); FLAC_API FLAC__bool FLAC__stream_encoder_disable_fixed_subframes(FLAC__StreamEncoder *encoder, FLAC__bool value); FLAC_API FLAC__bool FLAC__stream_encoder_disable_verbatim_subframes(FLAC__StreamEncoder *encoder, FLAC__bool value); diff --git a/src/libFLAC/Makefile.am b/src/libFLAC/Makefile.am index 40e3308d..dd2a5e39 100644 --- a/src/libFLAC/Makefile.am +++ b/src/libFLAC/Makefile.am @@ -56,6 +56,7 @@ EXTRA_DIST = \ CMakeLists.txt \ flac.pc.in \ libFLAC.m4 \ + deduplication/bitreader_read_rice_signed_block.c \ deduplication/lpc_compute_autocorrelation_intrin.c \ deduplication/lpc_compute_autocorrelation_intrin_sse2.c \ deduplication/lpc_compute_autocorrelation_intrin_neon.c diff --git a/src/libFLAC/bitreader.c b/src/libFLAC/bitreader.c index 56f992e4..af878e06 100644 --- a/src/libFLAC/bitreader.c +++ b/src/libFLAC/bitreader.c @@ -39,6 +39,7 @@ #include "private/bitmath.h" #include "private/bitreader.h" #include "private/crc.h" +#include "private/cpu.h" #include "private/macros.h" #include "FLAC/assert.h" #include "share/compat.h" @@ -831,149 +832,13 @@ FLAC__bool FLAC__bitreader_read_rice_signed(FLAC__BitReader *br, int *val, uint3 /* this is by far the most heavily used reader call. it ain't pretty but it's fast */ FLAC__bool FLAC__bitreader_read_rice_signed_block(FLAC__BitReader *br, int vals[], uint32_t nvals, uint32_t parameter) -{ - /* try and get br->consumed_words and br->consumed_bits into register; - * must remember to flush them back to *br before calling other - * bitreader functions that use them, and before returning */ - uint32_t cwords, words, lsbs, msbs, x, y, limit; - uint32_t ucbits; /* keep track of the number of unconsumed bits in word */ - brword b; - int *val, *end; - - FLAC__ASSERT(0 != br); - FLAC__ASSERT(0 != br->buffer); - /* WATCHOUT: code does not work with <32bit words; we can make things much faster with this assertion */ - FLAC__ASSERT(FLAC__BITS_PER_WORD >= 32); - FLAC__ASSERT(parameter < 32); - /* the above two asserts also guarantee that the binary part never straddles more than 2 words, so we don't have to loop to read it */ - - limit = UINT32_MAX >> parameter; /* Maximal msbs that can occur with residual bounded to int32_t */ - - val = vals; - end = vals + nvals; - - if(parameter == 0) { - while(val < end) { - /* read the unary MSBs and end bit */ - if(!FLAC__bitreader_read_unary_unsigned(br, &msbs)) - return false; - /* Checking limit here would be overzealous: coding UINT32_MAX - * with parameter == 0 would take 4GiB */ - *val++ = (int)(msbs >> 1) ^ -(int)(msbs & 1); - } - - return true; - } - - FLAC__ASSERT(parameter > 0); - - cwords = br->consumed_words; - words = br->words; - - /* if we've not consumed up to a partial tail word... */ - if(cwords >= words) { - x = 0; - goto process_tail; - } - - ucbits = FLAC__BITS_PER_WORD - br->consumed_bits; - b = br->buffer[cwords] << br->consumed_bits; /* keep unconsumed bits aligned to left */ - - while(val < end) { - /* read the unary MSBs and end bit */ - x = y = COUNT_ZERO_MSBS2(b); - if(x == FLAC__BITS_PER_WORD) { - x = ucbits; - do { - /* didn't find stop bit yet, have to keep going... */ - cwords++; - if (cwords >= words) - goto incomplete_msbs; - b = br->buffer[cwords]; - y = COUNT_ZERO_MSBS2(b); - x += y; - } while(y == FLAC__BITS_PER_WORD); - } - b <<= y; - b <<= 1; /* account for stop bit */ - ucbits = (ucbits - x - 1) % FLAC__BITS_PER_WORD; - msbs = x; - - if(x > limit) - return false; - - /* read the binary LSBs */ - x = (FLAC__uint32)(b >> (FLAC__BITS_PER_WORD - parameter)); /* parameter < 32, so we can cast to 32-bit uint32_t */ - if(parameter <= ucbits) { - ucbits -= parameter; - b <<= parameter; - } else { - /* there are still bits left to read, they will all be in the next word */ - cwords++; - if (cwords >= words) - goto incomplete_lsbs; - b = br->buffer[cwords]; - ucbits += FLAC__BITS_PER_WORD - parameter; - x |= (FLAC__uint32)(b >> ucbits); - b <<= FLAC__BITS_PER_WORD - ucbits; - } - lsbs = x; - - /* compose the value */ - x = (msbs << parameter) | lsbs; - *val++ = (int)(x >> 1) ^ -(int)(x & 1); - - continue; +#include "deduplication/bitreader_read_rice_signed_block.c" - /* at this point we've eaten up all the whole words */ -process_tail: - do { - if(0) { -incomplete_msbs: - br->consumed_bits = 0; - br->consumed_words = cwords; - } - - /* read the unary MSBs and end bit */ - if(!FLAC__bitreader_read_unary_unsigned(br, &msbs)) - return false; - msbs += x; - x = ucbits = 0; - - if(0) { -incomplete_lsbs: - br->consumed_bits = 0; - br->consumed_words = cwords; - } - - /* read the binary LSBs */ - if(!FLAC__bitreader_read_raw_uint32(br, &lsbs, parameter - ucbits)) - return false; - lsbs = x | lsbs; - - /* compose the value */ - x = (msbs << parameter) | lsbs; - *val++ = (int)(x >> 1) ^ -(int)(x & 1); - x = 0; - - cwords = br->consumed_words; - words = br->words; - ucbits = FLAC__BITS_PER_WORD - br->consumed_bits; - b = cwords < br->capacity ? br->buffer[cwords] << br->consumed_bits : 0; - } while(cwords >= words && val < end); - } - - if(ucbits == 0 && cwords < words) { - /* don't leave the head word with no unconsumed bits */ - cwords++; - ucbits = FLAC__BITS_PER_WORD; - } - - br->consumed_bits = FLAC__BITS_PER_WORD - ucbits; - br->consumed_words = cwords; - - return true; -} +#ifdef FLAC__BMI2_SUPPORTED +FLAC__SSE_TARGET("bmi2") +FLAC__bool FLAC__bitreader_read_rice_signed_block_bmi2(FLAC__BitReader *br, int vals[], uint32_t nvals, uint32_t parameter) +#include "deduplication/bitreader_read_rice_signed_block.c" +#endif #if 0 /* UNUSED */ FLAC__bool FLAC__bitreader_read_golomb_signed(FLAC__BitReader *br, int *val, uint32_t parameter) diff --git a/src/libFLAC/cpu.c b/src/libFLAC/cpu.c index 51f72ddf..a9d03d77 100644 --- a/src/libFLAC/cpu.c +++ b/src/libFLAC/cpu.c @@ -76,6 +76,7 @@ static const uint32_t FLAC__CPUINFO_X86_CPUID_FMA = 0x00001000; /* these are flags in EBX of CPUID AX=00000007 */ static const uint32_t FLAC__CPUINFO_X86_CPUID_AVX2 = 0x00000020; +static const uint32_t FLAC__CPUINFO_X86_CPUID_BMI2 = 0x00000100; static uint32_t cpu_xgetbv_x86(void) @@ -186,6 +187,7 @@ x86_cpu_info (FLAC__CPUInfo *info) info->x86.fma = (flags_ecx & FLAC__CPUINFO_X86_CPUID_FMA ) ? true : false; cpuinfo_x86(7, &flags_eax, &flags_ebx, &flags_ecx, &flags_edx); info->x86.avx2 = (flags_ebx & FLAC__CPUINFO_X86_CPUID_AVX2 ) ? true : false; + info->x86.bmi2 = (flags_ebx & FLAC__CPUINFO_X86_CPUID_BMI2 ) ? true : false; } #if defined FLAC__CPU_IA32 @@ -206,6 +208,7 @@ x86_cpu_info (FLAC__CPUInfo *info) dfprintf(stderr, " AVX ........ %c\n", info->x86.avx ? 'Y' : 'n'); dfprintf(stderr, " FMA ........ %c\n", info->x86.fma ? 'Y' : 'n'); dfprintf(stderr, " AVX2 ....... %c\n", info->x86.avx2 ? 'Y' : 'n'); + dfprintf(stderr, " BMI2 ....... %c\n", info->x86.bmi2 ? 'Y' : 'n'); } /* diff --git a/src/libFLAC/deduplication/bitreader_read_rice_signed_block.c b/src/libFLAC/deduplication/bitreader_read_rice_signed_block.c new file mode 100644 index 00000000..75ed47f7 --- /dev/null +++ b/src/libFLAC/deduplication/bitreader_read_rice_signed_block.c @@ -0,0 +1,143 @@ +{ + /* try and get br->consumed_words and br->consumed_bits into register; + * must remember to flush them back to *br before calling other + * bitreader functions that use them, and before returning */ + uint32_t cwords, words, lsbs, msbs, x, y, limit; + uint32_t ucbits; /* keep track of the number of unconsumed bits in word */ + brword b; + int *val, *end; + + FLAC__ASSERT(0 != br); + FLAC__ASSERT(0 != br->buffer); + /* WATCHOUT: code does not work with <32bit words; we can make things much faster with this assertion */ + FLAC__ASSERT(FLAC__BITS_PER_WORD >= 32); + FLAC__ASSERT(parameter < 32); + /* the above two asserts also guarantee that the binary part never straddles more than 2 words, so we don't have to loop to read it */ + + limit = UINT32_MAX >> parameter; /* Maximal msbs that can occur with residual bounded to int32_t */ + + val = vals; + end = vals + nvals; + + if(parameter == 0) { + while(val < end) { + /* read the unary MSBs and end bit */ + if(!FLAC__bitreader_read_unary_unsigned(br, &msbs)) + return false; + /* Checking limit here would be overzealous: coding UINT32_MAX + * with parameter == 0 would take 4GiB */ + *val++ = (int)(msbs >> 1) ^ -(int)(msbs & 1); + } + + return true; + } + + FLAC__ASSERT(parameter > 0); + + cwords = br->consumed_words; + words = br->words; + + /* if we've not consumed up to a partial tail word... */ + if(cwords >= words) { + x = 0; + goto process_tail; + } + + ucbits = FLAC__BITS_PER_WORD - br->consumed_bits; + b = br->buffer[cwords] << br->consumed_bits; /* keep unconsumed bits aligned to left */ + + while(val < end) { + /* read the unary MSBs and end bit */ + x = y = COUNT_ZERO_MSBS2(b); + if(x == FLAC__BITS_PER_WORD) { + x = ucbits; + do { + /* didn't find stop bit yet, have to keep going... */ + cwords++; + if (cwords >= words) + goto incomplete_msbs; + b = br->buffer[cwords]; + y = COUNT_ZERO_MSBS2(b); + x += y; + } while(y == FLAC__BITS_PER_WORD); + } + b <<= y; + b <<= 1; /* account for stop bit */ + ucbits = (ucbits - x - 1) % FLAC__BITS_PER_WORD; + msbs = x; + + if(x > limit) + return false; + + /* read the binary LSBs */ + x = (FLAC__uint32)(b >> (FLAC__BITS_PER_WORD - parameter)); /* parameter < 32, so we can cast to 32-bit uint32_t */ + if(parameter <= ucbits) { + ucbits -= parameter; + b <<= parameter; + } else { + /* there are still bits left to read, they will all be in the next word */ + cwords++; + if (cwords >= words) + goto incomplete_lsbs; + b = br->buffer[cwords]; + ucbits += FLAC__BITS_PER_WORD - parameter; + x |= (FLAC__uint32)(b >> ucbits); + b <<= FLAC__BITS_PER_WORD - ucbits; + } + lsbs = x; + + /* compose the value */ + x = (msbs << parameter) | lsbs; + *val++ = (int)(x >> 1) ^ -(int)(x & 1); + + continue; + + /* at this point we've eaten up all the whole words */ +process_tail: + do { + if(0) { +incomplete_msbs: + br->consumed_bits = 0; + br->consumed_words = cwords; + } + + /* read the unary MSBs and end bit */ + if(!FLAC__bitreader_read_unary_unsigned(br, &msbs)) + return false; + msbs += x; + x = ucbits = 0; + + if(0) { +incomplete_lsbs: + br->consumed_bits = 0; + br->consumed_words = cwords; + } + + /* read the binary LSBs */ + if(!FLAC__bitreader_read_raw_uint32(br, &lsbs, parameter - ucbits)) + return false; + lsbs = x | lsbs; + + /* compose the value */ + x = (msbs << parameter) | lsbs; + *val++ = (int)(x >> 1) ^ -(int)(x & 1); + x = 0; + + cwords = br->consumed_words; + words = br->words; + ucbits = FLAC__BITS_PER_WORD - br->consumed_bits; + b = cwords < br->capacity ? br->buffer[cwords] << br->consumed_bits : 0; + } while(cwords >= words && val < end); + } + + if(ucbits == 0 && cwords < words) { + /* don't leave the head word with no unconsumed bits */ + cwords++; + ucbits = FLAC__BITS_PER_WORD; + } + + br->consumed_bits = FLAC__BITS_PER_WORD - ucbits; + br->consumed_words = cwords; + + return true; +} diff --git a/src/libFLAC/include/private/bitreader.h b/src/libFLAC/include/private/bitreader.h index 2943a955..b450c27b 100644 --- a/src/libFLAC/include/private/bitreader.h +++ b/src/libFLAC/include/private/bitreader.h @@ -88,6 +88,10 @@ FLAC__bool FLAC__bitreader_read_byte_block_aligned_no_crc(FLAC__BitReader *br, F FLAC__bool FLAC__bitreader_read_unary_unsigned(FLAC__BitReader *br, uint32_t *val); FLAC__bool FLAC__bitreader_read_rice_signed(FLAC__BitReader *br, int *val, uint32_t parameter); FLAC__bool FLAC__bitreader_read_rice_signed_block(FLAC__BitReader *br, int vals[], uint32_t nvals, uint32_t parameter); +#ifdef FLAC__BMI2_SUPPORTED +FLAC__bool FLAC__bitreader_read_rice_signed_block_bmi2(FLAC__BitReader *br, int vals[], uint32_t nvals, uint32_t parameter); +#endif + #if 0 /* UNUSED */ FLAC__bool FLAC__bitreader_read_golomb_signed(FLAC__BitReader *br, int *val, uint32_t parameter); FLAC__bool FLAC__bitreader_read_golomb_unsigned(FLAC__BitReader *br, uint32_t *val, uint32_t parameter); diff --git a/src/libFLAC/include/private/cpu.h b/src/libFLAC/include/private/cpu.h index 1e444c09..4a79d64f 100644 --- a/src/libFLAC/include/private/cpu.h +++ b/src/libFLAC/include/private/cpu.h @@ -90,6 +90,7 @@ #define FLAC__AVX_SUPPORTED 1 #define FLAC__AVX2_SUPPORTED 1 #define FLAC__FMA_SUPPORTED 1 + #define FLAC__BMI2_SUPPORTED 1 #endif #elif defined __GNUC__ && !defined __clang__ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9)) /* GCC 4.9+ */ #define FLAC__SSE_TARGET(x) __attribute__ ((__target__ (x))) @@ -102,6 +103,7 @@ #define FLAC__AVX_SUPPORTED 1 #define FLAC__AVX2_SUPPORTED 1 #define FLAC__FMA_SUPPORTED 1 + #define FLAC__BMI2_SUPPORTED 1 #endif #elif defined _MSC_VER #define FLAC__SSE_TARGET(x) @@ -178,6 +180,7 @@ typedef struct { FLAC__bool avx; FLAC__bool avx2; FLAC__bool fma; + FLAC__bool bmi2; } FLAC__CPUInfo_x86; typedef struct { diff --git a/src/libFLAC/stream_decoder.c b/src/libFLAC/stream_decoder.c index 4ee53452..2c2b77e0 100644 --- a/src/libFLAC/stream_decoder.c +++ b/src/libFLAC/stream_decoder.c @@ -45,6 +45,7 @@ #include "protected/stream_decoder.h" #include "private/bitreader.h" #include "private/bitmath.h" +#include "private/cpu.h" #include "private/crc.h" #include "private/fixed.h" #include "private/format.h" @@ -147,6 +148,7 @@ typedef struct FLAC__StreamDecoderPrivate { size_t metadata_filter_ids_count, metadata_filter_ids_capacity; /* units for both are IDs, not bytes */ FLAC__Frame frame; FLAC__bool cached; /* true if there is a byte in lookahead */ + FLAC__CPUInfo cpuinfo; FLAC__byte header_warmup[2]; /* contains the sync code and reserved bits */ FLAC__byte lookahead; /* temp storage when we need to look ahead one byte in the stream */ /* unaligned (original) pointers to allocated data */ @@ -164,6 +166,7 @@ typedef struct FLAC__StreamDecoderPrivate { FLAC__uint64 target_sample; uint32_t unparseable_frame_count; /* used to tell whether we're decoding a future version of FLAC or just got a bad sync */ FLAC__bool got_a_frame; /* hack needed in Ogg FLAC seek routine to check when process_single() actually writes a frame */ + FLAC__bool (*local_bitreader_read_rice_signed_block)(FLAC__BitReader *br, int vals[], uint32_t nvals, uint32_t parameter); } FLAC__StreamDecoderPrivate; /*********************************************************************** @@ -369,6 +372,15 @@ static FLAC__StreamDecoderInitStatus init_stream_internal_( return decoder->protected_->initstate = FLAC__STREAM_DECODER_INIT_STATUS_ERROR_OPENING_FILE; #endif + FLAC__cpu_info(&decoder->private_->cpuinfo); + decoder->private_->local_bitreader_read_rice_signed_block = FLAC__bitreader_read_rice_signed_block; + +#ifdef FLAC__BMI2_SUPPORTED + if (decoder->private_->cpuinfo.x86.bmi2) { + decoder->private_->local_bitreader_read_rice_signed_block = FLAC__bitreader_read_rice_signed_block_bmi2; + } +#endif + /* from here on, errors are fatal */ if(!FLAC__bitreader_init(decoder->private_->input, read_callback_, decoder)) { @@ -2948,7 +2960,7 @@ FLAC__bool read_residual_partitioned_rice_(FLAC__StreamDecoder *decoder, uint32_ if(rice_parameter < pesc) { partitioned_rice_contents->raw_bits[partition] = 0; u = (partition == 0) ? partition_samples - predictor_order : partition_samples; - if(!FLAC__bitreader_read_rice_signed_block(decoder->private_->input, residual + sample, u, rice_parameter)){ + if(!decoder->private_->local_bitreader_read_rice_signed_block(decoder->private_->input, residual + sample, u, rice_parameter)){ if(decoder->protected_->state == FLAC__STREAM_DECODER_READ_FRAME) { /* no error was set, read_callback_ didn't set it, so * invalid rice symbol was found */ -- cgit v1.2.3 From 43bc8101ce70eaeebf71c6d4b3cb4d3e1ce82ff7 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Wed, 8 Mar 2023 10:11:30 +0100 Subject: Switch default bitreader/bitwriter word size to 64-bit --- .github/workflows/action.yml | 36 ++++++++++++++++++------------------ .travis.yml | 4 ++-- configure.ac | 10 +++++----- src/CMakeLists.txt | 2 +- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index 69535243..54108fa5 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -19,12 +19,12 @@ jobs: macos-latest-clang-autotools, macos-latest-clang-cmake, windows-latest-cmake, - ubuntu-latest-gcc-autotools-64-bit-words, - ubuntu-latest-clang-autotools-64-bit-words, - ubuntu-latest-gcc-cmake-64-bit-words, - ubuntu-latest-clang-cmake-64-bit-words, - macos-latest-clang-autotools-64-bit-words, - macos-latest-clang-cmake-64-bit-words + ubuntu-latest-gcc-autotools-32-bit-words, + ubuntu-latest-clang-autotools-32-bit-words, + ubuntu-latest-gcc-cmake-32-bit-words, + ubuntu-latest-clang-cmake-32-bit-words, + macos-latest-clang-autotools-32-bit-words, + macos-latest-clang-cmake-32-bit-words ] include: - name: ubuntu-latest-gcc-autotools @@ -79,47 +79,47 @@ jobs: build-system: cmake configure-opts: '-DBUILD_SHARED_LIBS=ON' - - name: ubuntu-latest-gcc-autotools-64-bit-words + - name: ubuntu-latest-gcc-autotools-32-bit-words os: ubuntu-latest cc: gcc cxx: g++ build-system: autotools - configure-opts: --enable-64-bit-words + configure-opts: --disable-64-bit-words - - name: ubuntu-latest-clang-autotools-64-bit-words + - name: ubuntu-latest-clang-autotools-32-bit-words os: ubuntu-latest cc: clang cxx: clang++ build-system: autotools - configure-opts: --enable-64-bit-words + configure-opts: --disable-64-bit-words - - name: ubuntu-latest-gcc-cmake-64-bit-words + - name: ubuntu-latest-gcc-cmake-32-bit-words os: ubuntu-latest cc: gcc cxx: g++ build-system: cmake - configure-opts: -DENABLE_64_BIT_WORDS=ON + configure-opts: -DENABLE_64_BIT_WORDS=OFF - - name: ubuntu-latest-clang-cmake-64-bit-words + - name: ubuntu-latest-clang-cmake-32-bit-words os: ubuntu-latest cc: clang cxx: clang++ build-system: cmake - configure-opts: -DENABLE_64_BIT_WORDS=ON + configure-opts: -DENABLE_64_BIT_WORDS=OFF - - name: macos-latest-clang-autotools-64-bit-words + - name: macos-latest-clang-autotools-32-bit-words os: macos-latest cc: clang cxx: clang++ build-system: autotools - configure-opts: --enable-64-bit-words + configure-opts: --disable-64-bit-words - - name: macos-latest-clang-cmake-64-bit-words + - name: macos-latest-clang-cmake-32-bit-words os: macos-latest cc: clang cxx: clang++ build-system: cmake - configure-opts: -DENABLE_64_BIT_WORDS=ON + configure-opts: -DENABLE_64_BIT_WORDS=OFF runs-on: ${{ matrix.os }} diff --git a/.travis.yml b/.travis.yml index f635bad3..a4de8301 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,7 +26,7 @@ jobs: dist: focal arch: arm64 compiler: gcc - env: BUILD_SYSTEM="cmake" CONFIGURE_OPTS=-DENABLE_64_BIT_WORDS=ON + env: BUILD_SYSTEM="cmake" CONFIGURE_OPTS=-DENABLE_64_BIT_WORDS=OFF - os: linux dist: focal arch: ppc64le @@ -51,7 +51,7 @@ jobs: dist: focal arch: ppc64le compiler: gcc - env: BUILD_SYSTEM="cmake" CONFIGURE_OPTS=-DENABLE_64_BIT_WORDS=ON + env: BUILD_SYSTEM="cmake" CONFIGURE_OPTS=-DENABLE_64_BIT_WORDS=OFF install: - if [ $TRAVIS_OS_NAME = linux ]; then sudo apt-get -y install libtool-bin libogg-dev; fi diff --git a/configure.ac b/configure.ac index 6842b8ff..5358fa8f 100644 --- a/configure.ac +++ b/configure.ac @@ -265,12 +265,12 @@ esac AC_ARG_ENABLE(64-bit-words, - AS_HELP_STRING([--enable-64-bit-words],[Set FLAC__BYTES_PER_WORD to 8 (4 is the default)])) -if test "x$enable_64_bit_words" = xyes ; then - AC_DEFINE_UNQUOTED([ENABLE_64_BIT_WORDS],1,[Set FLAC__BYTES_PER_WORD to 8 (4 is the default)]) + AS_HELP_STRING([--disable-64-bit-words],[Set FLAC__BYTES_PER_WORD to 4 (8 is the default)])) +if test "x$enable_64_bit_words" = xno ; then + AC_DEFINE_UNQUOTED([ENABLE_64_BIT_WORDS],0,[Set FLAC__BYTES_PER_WORD to 8 (this is the default)]) else - AC_DEFINE_UNQUOTED([ENABLE_64_BIT_WORDS],0) - fi + AC_DEFINE_UNQUOTED([ENABLE_64_BIT_WORDS],1) +fi AC_SUBST(ENABLE_64_BIT_WORDS) AC_ARG_ENABLE(valgrind-testing, diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 97e397aa..262feead 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.11) -option(ENABLE_64_BIT_WORDS "Set FLAC__BYTES_PER_WORD to 8 (4 is the default)" OFF) +option(ENABLE_64_BIT_WORDS "Set FLAC__BYTES_PER_WORD to 8, for 64-bit machines. For 32-bit machines, turning this off might give a tiny speed improvement" ON) option(BUILD_UTILS "Build utils" OFF) add_subdirectory("libFLAC") -- cgit v1.2.3 From 9ee21a0e68de3fd1a59cf5f420220155245576ca Mon Sep 17 00:00:00 2001 From: Zhipeng Xue <543984341@qq.com> Date: Tue, 28 Mar 2023 13:07:06 +0800 Subject: Fix potential dead store --- src/libFLAC/metadata_iterators.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libFLAC/metadata_iterators.c b/src/libFLAC/metadata_iterators.c index 7adb45a5..d0e4a520 100644 --- a/src/libFLAC/metadata_iterators.c +++ b/src/libFLAC/metadata_iterators.c @@ -2343,7 +2343,7 @@ FLAC__Metadata_SimpleIteratorStatus read_metadata_block_data_vorbis_comment_entr if(max_length < entry->length) { entry->length = 0; return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_BAD_METADATA; - } else max_length -= entry->length; + } if(0 != entry->entry) free(entry->entry); -- cgit v1.2.3 From bacc9d8c66cb51cd9ffd2307b2ae07090b2bfd87 Mon Sep 17 00:00:00 2001 From: orbea Date: Wed, 29 Mar 2023 09:29:28 -0700 Subject: getopt: Fix the build with clang-16 Clang-16 no longer allows these legacy declarations. --- src/share/getopt/getopt1.c | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/src/share/getopt/getopt1.c b/src/share/getopt/getopt1.c index 740e498b..e6f98f9d 100644 --- a/src/share/getopt/getopt1.c +++ b/src/share/getopt/getopt1.c @@ -79,13 +79,7 @@ #define NULL 0 #endif -int -share__getopt_long (argc, argv, options, long_options, opt_index) - int argc; - char *const *argv; - const char *options; - const struct share__option *long_options; - int *opt_index; +int share__getopt_long(int argc, char *const *argv, const char *options, const struct share__option *long_options, int *opt_index) { return share___getopt_internal (argc, argv, options, long_options, opt_index, 0); } @@ -95,13 +89,7 @@ share__getopt_long (argc, argv, options, long_options, opt_index) but does match a short option, it is parsed as a short option instead. */ -int -share__getopt_long_only (argc, argv, options, long_options, opt_index) - int argc; - char *const *argv; - const char *options; - const struct share__option *long_options; - int *opt_index; +int share__getopt_long_only(int argc, char *const *argv, const char *options, const struct share__option *long_options, int *opt_index) { return share___getopt_internal (argc, argv, options, long_options, opt_index, 1); } @@ -113,10 +101,7 @@ share__getopt_long_only (argc, argv, options, long_options, opt_index) #include -int -main (argc, argv) - int argc; - char **argv; +int main(int argc, char **argv) { int c; int digit_optind = 0; -- cgit v1.2.3 From 775d214cddd7b77d18bb7ca419adec0e933eea68 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Fri, 7 Apr 2023 20:45:28 +0200 Subject: Fix leak in metaflac This leak seems to have been introduced by b3b9176 Credit: Oss-Fuzz Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=57641 --- src/metaflac/operations.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/metaflac/operations.c b/src/metaflac/operations.c index 631fd21b..7ae3c635 100644 --- a/src/metaflac/operations.c +++ b/src/metaflac/operations.c @@ -197,6 +197,7 @@ FLAC__bool do_major_operation__list(const char *filename, FLAC__Metadata_Chain * FLAC__byte * block_raw = FLAC__metadata_object_get_raw(block); if(block_raw == 0) { flac_fprintf(stderr, "%s: ERROR: couldn't get block in raw form\n", filename); + FLAC__metadata_iterator_delete(iterator); return false; } write_metadata_binary(block, block_raw, options->data_format_is_binary_headerless); -- cgit v1.2.3 From 499f85f9bca03b90de3477367546b4e6e6b93511 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Fri, 7 Apr 2023 21:13:37 +0200 Subject: Also let stream_decoder not return NULL vorbiscomment entries See commit e5c7144 for similar fixes. Credit: Oss-Fuzz Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=57411 --- src/libFLAC/stream_decoder.c | 70 ++++++++++++++++------------------- src/test_libs_common/metadata_utils.c | 3 +- 2 files changed, 33 insertions(+), 40 deletions(-) diff --git a/src/libFLAC/stream_decoder.c b/src/libFLAC/stream_decoder.c index 2c2b77e0..6a5b4387 100644 --- a/src/libFLAC/stream_decoder.c +++ b/src/libFLAC/stream_decoder.c @@ -1701,24 +1701,20 @@ FLAC__bool read_metadata_vorbiscomment_(FLAC__StreamDecoder *decoder, FLAC__Stre FLAC__ASSERT(FLAC__STREAM_METADATA_VORBIS_COMMENT_ENTRY_LENGTH_LEN == 32); if (!FLAC__bitreader_read_uint32_little_endian(decoder->private_->input, &obj->vendor_string.length)) return false; /* read_callback_ sets the state for us */ - if (obj->vendor_string.length > 0) { - if (length < obj->vendor_string.length) { - obj->vendor_string.length = 0; - obj->vendor_string.entry = 0; - goto skip; - } - else - length -= obj->vendor_string.length; - if (0 == (obj->vendor_string.entry = safe_malloc_add_2op_(obj->vendor_string.length, /*+*/1))) { - decoder->protected_->state = FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR; - return false; - } - if (!FLAC__bitreader_read_byte_block_aligned_no_crc(decoder->private_->input, obj->vendor_string.entry, obj->vendor_string.length)) - return false; /* read_callback_ sets the state for us */ - obj->vendor_string.entry[obj->vendor_string.length] = '\0'; + if (length < obj->vendor_string.length) { + obj->vendor_string.length = 0; + obj->vendor_string.entry = 0; + goto skip; } else - obj->vendor_string.entry = 0; + length -= obj->vendor_string.length; + if (0 == (obj->vendor_string.entry = safe_malloc_add_2op_(obj->vendor_string.length, /*+*/1))) { + decoder->protected_->state = FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR; + return false; + } + if (!FLAC__bitreader_read_byte_block_aligned_no_crc(decoder->private_->input, obj->vendor_string.entry, obj->vendor_string.length)) + return false; /* read_callback_ sets the state for us */ + obj->vendor_string.entry[obj->vendor_string.length] = '\0'; /* read num comments */ FLAC__ASSERT(FLAC__STREAM_METADATA_VORBIS_COMMENT_NUM_COMMENTS_LEN == 32); @@ -1753,31 +1749,27 @@ FLAC__bool read_metadata_vorbiscomment_(FLAC__StreamDecoder *decoder, FLAC__Stre obj->num_comments = i; return false; /* read_callback_ sets the state for us */ } - if (obj->comments[i].length > 0) { - if (length < obj->comments[i].length) { - obj->num_comments = i; - FLAC__bitreader_limit_invalidate(decoder->private_->input); - return false; - } - else - length -= obj->comments[i].length; - if (0 == (obj->comments[i].entry = safe_malloc_add_2op_(obj->comments[i].length, /*+*/1))) { - decoder->protected_->state = FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR; - obj->num_comments = i; - return false; - } - memset (obj->comments[i].entry, 0, obj->comments[i].length) ; - if (!FLAC__bitreader_read_byte_block_aligned_no_crc(decoder->private_->input, obj->comments[i].entry, obj->comments[i].length)) { - /* Current i-th entry is bad, so we delete it. */ - free (obj->comments[i].entry) ; - obj->comments[i].entry = NULL ; - obj->num_comments = i; - goto skip; - } - obj->comments[i].entry[obj->comments[i].length] = '\0'; + if (length < obj->comments[i].length) { + obj->num_comments = i; + FLAC__bitreader_limit_invalidate(decoder->private_->input); + return false; } else - obj->comments[i].entry = 0; + length -= obj->comments[i].length; + if (0 == (obj->comments[i].entry = safe_malloc_add_2op_(obj->comments[i].length, /*+*/1))) { + decoder->protected_->state = FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR; + obj->num_comments = i; + return false; + } + memset (obj->comments[i].entry, 0, obj->comments[i].length) ; + if (!FLAC__bitreader_read_byte_block_aligned_no_crc(decoder->private_->input, obj->comments[i].entry, obj->comments[i].length)) { + /* Current i-th entry is bad, so we delete it. */ + free (obj->comments[i].entry) ; + obj->comments[i].entry = NULL ; + obj->num_comments = i; + goto skip; + } + obj->comments[i].entry[obj->comments[i].length] = '\0'; } } } diff --git a/src/test_libs_common/metadata_utils.c b/src/test_libs_common/metadata_utils.c index 38fe2aa8..f0d77a1e 100644 --- a/src/test_libs_common/metadata_utils.c +++ b/src/test_libs_common/metadata_utils.c @@ -511,7 +511,8 @@ void mutils__init_metadata_blocks( vorbiscomment->data.vorbis_comment.comments[0].entry = malloc_or_die_(5+1); memcpy(vorbiscomment->data.vorbis_comment.comments[0].entry, "ab=cd", 5+1); vorbiscomment->data.vorbis_comment.comments[1].length = 0; - vorbiscomment->data.vorbis_comment.comments[1].entry = 0; + vorbiscomment->data.vorbis_comment.comments[1].entry = malloc_or_die_(1); + vorbiscomment->data.vorbis_comment.comments[1].entry[0] = '\0'; } cuesheet->is_last = false; -- cgit v1.2.3 From 851c0b9c155ecb7d684f5c1d15143fdae2732d78 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Fri, 7 Apr 2023 21:28:06 +0200 Subject: Fix another leak in metaflac Credit: Oss-Fuzz Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=57362 --- src/metaflac/operations_shorthand_cuesheet.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/metaflac/operations_shorthand_cuesheet.c b/src/metaflac/operations_shorthand_cuesheet.c index 2e500502..99737550 100644 --- a/src/metaflac/operations_shorthand_cuesheet.c +++ b/src/metaflac/operations_shorthand_cuesheet.c @@ -146,6 +146,7 @@ FLAC__bool import_cs_from(const char *filename, FLAC__StreamMetadata **cuesheet, if(!FLAC__format_cuesheet_is_legal(&(*cuesheet)->data.cue_sheet, /*check_cd_da_subset=*/false, &error_message)) { flac_fprintf(stderr, "%s: ERROR parsing cuesheet \"%s\": %s\n", filename, cs_filename, error_message); + FLAC__metadata_object_delete(*cuesheet); return false; } -- cgit v1.2.3 From f191bc3d6c0568c88e6b4a66521881c7af460127 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Fri, 7 Apr 2023 21:49:26 +0200 Subject: Silence Clang warnings, see commit be1df40 for details --- src/libFLAC/fixed_intrin_avx2.c | 50 ++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/src/libFLAC/fixed_intrin_avx2.c b/src/libFLAC/fixed_intrin_avx2.c index e515e230..9559f748 100644 --- a/src/libFLAC/fixed_intrin_avx2.c +++ b/src/libFLAC/fixed_intrin_avx2.c @@ -80,16 +80,16 @@ uint32_t FLAC__fixed_compute_best_predictor_wide_intrin_avx2(const FLAC__int32 d prev_err2_scalar[i] = prev_err1_scalar[i] - (data[-2+i*(data_len_int/4)] - data[-3+i*(data_len_int/4)]); prev_err3_scalar[i] = prev_err2_scalar[i] - (data[-2+i*(data_len_int/4)] - 2*data[-3+i*(data_len_int/4)] + data[-4+i*(data_len_int/4)]); } - prev_err0 = _mm256_loadu_si256((const __m256i*)prev_err0_scalar); - prev_err1 = _mm256_loadu_si256((const __m256i*)prev_err1_scalar); - prev_err2 = _mm256_loadu_si256((const __m256i*)prev_err2_scalar); - prev_err3 = _mm256_loadu_si256((const __m256i*)prev_err3_scalar); + prev_err0 = _mm256_loadu_si256((const __m256i*)(void*)prev_err0_scalar); + prev_err1 = _mm256_loadu_si256((const __m256i*)(void*)prev_err1_scalar); + prev_err2 = _mm256_loadu_si256((const __m256i*)(void*)prev_err2_scalar); + prev_err3 = _mm256_loadu_si256((const __m256i*)(void*)prev_err3_scalar); for(i = 0; i < data_len_int / 4; i++){ data_scalar[0] = data[i]; data_scalar[1] = data[i+data_len/4]; data_scalar[2] = data[i+2*data_len/4]; data_scalar[3] = data[i+3*data_len/4]; - tempA = _mm256_loadu_si256((const __m256i*)data_scalar); + tempA = _mm256_loadu_si256((const __m256i*)(void*)data_scalar); /* Next three intrinsics calculate tempB as abs of tempA */ bitmask = _mm256_cmpgt_epi64(_mm256_set1_epi64x(0), tempA); tempB = _mm256_xor_si256(tempA, bitmask); @@ -124,15 +124,15 @@ uint32_t FLAC__fixed_compute_best_predictor_wide_intrin_avx2(const FLAC__int32 d tempB = _mm256_sub_epi64(tempB, bitmask); total_err4 = _mm256_add_epi64(total_err4,tempB); } - _mm256_storeu_si256((__m256i*)data_scalar,total_err0); + _mm256_storeu_si256((__m256i*)(void*)data_scalar,total_err0); total_error_0 = data_scalar[0] + data_scalar[1] + data_scalar[2] + data_scalar[3]; - _mm256_storeu_si256((__m256i*)data_scalar,total_err1); + _mm256_storeu_si256((__m256i*)(void*)data_scalar,total_err1); total_error_1 = data_scalar[0] + data_scalar[1] + data_scalar[2] + data_scalar[3]; - _mm256_storeu_si256((__m256i*)data_scalar,total_err2); + _mm256_storeu_si256((__m256i*)(void*)data_scalar,total_err2); total_error_2 = data_scalar[0] + data_scalar[1] + data_scalar[2] + data_scalar[3]; - _mm256_storeu_si256((__m256i*)data_scalar,total_err3); + _mm256_storeu_si256((__m256i*)(void*)data_scalar,total_err3); total_error_3 = data_scalar[0] + data_scalar[1] + data_scalar[2] + data_scalar[3]; - _mm256_storeu_si256((__m256i*)data_scalar,total_err4); + _mm256_storeu_si256((__m256i*)(void*)data_scalar,total_err4); total_error_4 = data_scalar[0] + data_scalar[1] + data_scalar[2] + data_scalar[3]; /* Ignore the remainder, we're ignore the first few samples too */ @@ -236,16 +236,16 @@ uint32_t FLAC__fixed_compute_best_predictor_limit_residual_intrin_avx2(const FLA prev_err2_scalar[i] = prev_err1_scalar[i] - ((FLAC__int64)(data[-2+i*(data_len_int/4)]) - data[-3+i*(data_len_int/4)]); prev_err3_scalar[i] = prev_err2_scalar[i] - ((FLAC__int64)(data[-2+i*(data_len_int/4)]) - 2*(FLAC__int64)(data[-3+i*(data_len_int/4)]) + data[-4+i*(data_len_int/4)]); } - prev_err0 = _mm256_loadu_si256((const __m256i*)prev_err0_scalar); - prev_err1 = _mm256_loadu_si256((const __m256i*)prev_err1_scalar); - prev_err2 = _mm256_loadu_si256((const __m256i*)prev_err2_scalar); - prev_err3 = _mm256_loadu_si256((const __m256i*)prev_err3_scalar); + prev_err0 = _mm256_loadu_si256((const __m256i*)(void*)prev_err0_scalar); + prev_err1 = _mm256_loadu_si256((const __m256i*)(void*)prev_err1_scalar); + prev_err2 = _mm256_loadu_si256((const __m256i*)(void*)prev_err2_scalar); + prev_err3 = _mm256_loadu_si256((const __m256i*)(void*)prev_err3_scalar); for(i = 0; i < data_len_int / 4; i++){ data_scalar[0] = data[i]; data_scalar[1] = data[i+data_len/4]; data_scalar[2] = data[i+2*data_len/4]; data_scalar[3] = data[i+3*data_len/4]; - tempA = _mm256_loadu_si256((const __m256i*)data_scalar); + tempA = _mm256_loadu_si256((const __m256i*)(void*)data_scalar); /* Next three intrinsics calculate tempB as abs of tempA */ bitmask = _mm256_cmpgt_epi64(_mm256_set1_epi64x(0), tempA); tempB = _mm256_xor_si256(tempA, bitmask); @@ -285,25 +285,25 @@ uint32_t FLAC__fixed_compute_best_predictor_limit_residual_intrin_avx2(const FLA total_err4 = _mm256_add_epi64(total_err4,tempB); shadow_err4 = _mm256_or_si256(shadow_err4,tempB); } - _mm256_storeu_si256((__m256i*)data_scalar,total_err0); + _mm256_storeu_si256((__m256i*)(void*)data_scalar,total_err0); total_error_0 += data_scalar[0] + data_scalar[1] + data_scalar[2] + data_scalar[3]; - _mm256_storeu_si256((__m256i*)data_scalar,total_err1); + _mm256_storeu_si256((__m256i*)(void*)data_scalar,total_err1); total_error_1 += data_scalar[0] + data_scalar[1] + data_scalar[2] + data_scalar[3]; - _mm256_storeu_si256((__m256i*)data_scalar,total_err2); + _mm256_storeu_si256((__m256i*)(void*)data_scalar,total_err2); total_error_2 += data_scalar[0] + data_scalar[1] + data_scalar[2] + data_scalar[3]; - _mm256_storeu_si256((__m256i*)data_scalar,total_err3); + _mm256_storeu_si256((__m256i*)(void*)data_scalar,total_err3); total_error_3 += data_scalar[0] + data_scalar[1] + data_scalar[2] + data_scalar[3]; - _mm256_storeu_si256((__m256i*)data_scalar,total_err4); + _mm256_storeu_si256((__m256i*)(void*)data_scalar,total_err4); total_error_4 += data_scalar[0] + data_scalar[1] + data_scalar[2] + data_scalar[3]; - _mm256_storeu_si256((__m256i*)data_scalar,shadow_err0); + _mm256_storeu_si256((__m256i*)(void*)data_scalar,shadow_err0); shadow_error_0 |= data_scalar[0] | data_scalar[1] | data_scalar[2] | data_scalar[3]; - _mm256_storeu_si256((__m256i*)data_scalar,shadow_err1); + _mm256_storeu_si256((__m256i*)(void*)data_scalar,shadow_err1); shadow_error_1 |= data_scalar[0] | data_scalar[1] | data_scalar[2] | data_scalar[3]; - _mm256_storeu_si256((__m256i*)data_scalar,shadow_err2); + _mm256_storeu_si256((__m256i*)(void*)data_scalar,shadow_err2); shadow_error_2 |= data_scalar[0] | data_scalar[1] | data_scalar[2] | data_scalar[3]; - _mm256_storeu_si256((__m256i*)data_scalar,shadow_err3); + _mm256_storeu_si256((__m256i*)(void*)data_scalar,shadow_err3); shadow_error_3 |= data_scalar[0] | data_scalar[1] | data_scalar[2] | data_scalar[3]; - _mm256_storeu_si256((__m256i*)data_scalar,shadow_err4); + _mm256_storeu_si256((__m256i*)(void*)data_scalar,shadow_err4); shadow_error_4 |= data_scalar[0] | data_scalar[1] | data_scalar[2] | data_scalar[3]; /* Take care of remaining sample */ -- cgit v1.2.3 From 4b2c33ebf2582cb946c94ff4b603338fb0a33c52 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Mon, 10 Apr 2023 08:08:54 +0200 Subject: Check for overflow in parsing skip/until specification (#584) Credit: Oss-Fuzz Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=57259 --- src/flac/utils.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/flac/utils.c b/src/flac/utils.c index d236dc8e..092dfd5c 100644 --- a/src/flac/utils.c +++ b/src/flac/utils.c @@ -56,8 +56,12 @@ static FLAC__bool local__parse_uint64_(const char *s, FLAC__uint64 *value) return false; while('\0' != (c = *s++)) - if(c >= '0' && c <= '9') + if(c >= '0' && c <= '9') { + FLAC__uint64 tmp = ret; ret = ret * 10 + (c - '0'); + if(ret < tmp) /* check for overflow */ + return false; + } else return false; @@ -300,6 +304,8 @@ FLAC__bool flac__utils_parse_skip_until_specification(const char *s, utils__Skip if(local__parse_uint64_(s, &val)) { spec->value_is_samples = true; + if(val > INT64_MAX) + return false; spec->value.samples = (FLAC__int64)val; if(is_negative) spec->value.samples = -(spec->value.samples); -- cgit v1.2.3 From f7bd64bc70d037be11e0484ee903393c9840bffd Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Tue, 11 Apr 2023 10:44:36 +0200 Subject: Add help and man text for --append --- man/metaflac.md | 25 +++++++++++++++++++------ src/metaflac/usage.c | 10 ++++++++++ 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/man/metaflac.md b/man/metaflac.md index 9efc827a..5a7f8850 100644 --- a/man/metaflac.md +++ b/man/metaflac.md @@ -261,12 +261,25 @@ modification time is set to the current time): application data contents instead using \--application-data-format=hexdump. -**\--data-format=binary\|binary-headerless\|text** -: By default a human-readable text representation of the data is - displayed. You may specify --data-format=binary to dump the raw - binary form of each metadata block. Specify - --data-format=binary-headerless to omit output of metadata block - headers, including the id of APPLICATION metadata blocks. +**\--data-format=binary\|binary-headerless\|text** +: For use with --list. By default a human-readable text + representation of the data is isplayed. You may specify + --data-format=binary to dump the raw binary form of each metadata + block. Specify --data-format=binary-headerless to omit output of + metadata block headers, including the id of APPLICATION metadata + blocks. + +**\--append** +: Insert a metadata block from a file. This must be a binary block as + exported with --list --data-format=binary. The insertion point is + defined with --block-number=#. The new block will be added after the + given block number. This prevents the illegal insertion of a block + before the first STREAMINFO block. You may not --append another + STREAMINFO block. It is possible to copy a metadata block from one + file to another with this option. For example use + `metaflac --list --data-format=binary --block-number=6 file.flac > block` + to export the block, and then import it with + `metaflac --append anotherfile.flac < block` **\--remove-all** : Remove all metadata blocks (except the STREAMINFO block) from the diff --git a/src/metaflac/usage.c b/src/metaflac/usage.c index 603e3285..4690134b 100644 --- a/src/metaflac/usage.c +++ b/src/metaflac/usage.c @@ -289,6 +289,16 @@ int long_usage(const char *message, ...) fprintf(out, " contents instead using --application-data-format=hexdump\n"); fprintf(out, "\n"); fprintf(out, "--append\n"); + fprintf(out, " Insert a metadata block from a file. This must be a binary block as\n"); + fprintf(out, " exported with --list --data-format=binary. The insertion point is\n"); + fprintf(out, " defined with --block-number=#. The new block will be added after the\n"); + fprintf(out, " given block number. This prevents the illegal insertion of a block\n"); + fprintf(out, " before the first STREAMINFO block. You may not --append another\n"); + fprintf(out, " STREAMINFO block. It is possible to copy a metadata block from one\n"); + fprintf(out, " file to another with this option. For example use\n"); + fprintf(out, " metaflac --list --data-format=binary --block-number=6 file.flac > block\n"); + fprintf(out, " to export the block, and then import it with\n"); + fprintf(out, " metaflac --append anotherfile.flac < block\n"); fprintf(out, " Insert a metadata block from a file. The input file must be in the same\n"); fprintf(out, " format as generated with --list.\n"); fprintf(out, "\n"); -- cgit v1.2.3 From f8be98e107690bf84774c31a663e93b9ee072c8a Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Mon, 17 Apr 2023 09:34:57 +0200 Subject: Improve overflow checking of commit 4b2c33e --- src/flac/utils.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/flac/utils.c b/src/flac/utils.c index 092dfd5c..e043ee7c 100644 --- a/src/flac/utils.c +++ b/src/flac/utils.c @@ -57,10 +57,16 @@ static FLAC__bool local__parse_uint64_(const char *s, FLAC__uint64 *value) while('\0' != (c = *s++)) if(c >= '0' && c <= '9') { - FLAC__uint64 tmp = ret; - ret = ret * 10 + (c - '0'); - if(ret < tmp) /* check for overflow */ + if(ret > UINT64_MAX / 10) /* check for overflow */ return false; + else if(ret == UINT64_MAX / 10) { + FLAC__uint64 tmp = ret; + ret = ret * 10 + (c - '0'); + if(ret < tmp) + return false; + } + else + ret = ret * 10 + (c - '0'); } else return false; -- cgit v1.2.3 From 139cd330af8c36b0a5d58e4e4e957c7e2cb5fc53 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Mon, 17 Apr 2023 12:12:24 +0200 Subject: Allow sample rate == 0, as per IETF spec See https://www.ietf.org/archive/id/draft-ietf-cellar-flac-08.html#name-streaminfo Credit: Oss-Fuzz Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=57456 --- src/libFLAC/format.c | 2 +- src/test_libFLAC/format.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libFLAC/format.c b/src/libFLAC/format.c index 31ffdc2f..e434dd73 100644 --- a/src/libFLAC/format.c +++ b/src/libFLAC/format.c @@ -208,7 +208,7 @@ FLAC_API const char * const FLAC__StreamMetadata_Picture_TypeString[] = { FLAC_API FLAC__bool FLAC__format_sample_rate_is_valid(uint32_t sample_rate) { - if(sample_rate == 0 || sample_rate > FLAC__MAX_SAMPLE_RATE) { + if(sample_rate > FLAC__MAX_SAMPLE_RATE) { return false; } else diff --git a/src/test_libFLAC/format.c b/src/test_libFLAC/format.c index 4071b1c4..af447139 100644 --- a/src/test_libFLAC/format.c +++ b/src/test_libFLAC/format.c @@ -33,7 +33,7 @@ static struct { FLAC__bool valid; FLAC__bool subset; } SAMPLE_RATES[] = { - { 0 , false, false }, + { 0 , true , true }, { 1 , true , true }, { 9 , true , true }, { 10 , true , true }, -- cgit v1.2.3 From 1faa4924e2d6e5e4781d0fedf8a96c521f2cc794 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Mon, 17 Apr 2023 14:20:18 +0200 Subject: Treat cuesheets with 0 tracks as invalid Credit: Oss-Fuzz Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=57904 --- src/libFLAC/metadata_iterators.c | 2 +- src/libFLAC/stream_decoder.c | 4 ++++ src/share/grabbag/cuesheet.c | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/libFLAC/metadata_iterators.c b/src/libFLAC/metadata_iterators.c index d0e4a520..16fa2f1d 100644 --- a/src/libFLAC/metadata_iterators.c +++ b/src/libFLAC/metadata_iterators.c @@ -2518,7 +2518,7 @@ FLAC__Metadata_SimpleIteratorStatus read_metadata_block_data_cuesheet_cb_(FLAC__ block->num_tracks = unpack_uint32_(buffer, len); if(block->num_tracks == 0) { - block->tracks = 0; + return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_BAD_METADATA; } else if(0 == (block->tracks = calloc(block->num_tracks, sizeof(FLAC__StreamMetadata_CueSheet_Track)))) return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_MEMORY_ALLOCATION_ERROR; diff --git a/src/libFLAC/stream_decoder.c b/src/libFLAC/stream_decoder.c index 6a5b4387..8ce6d605 100644 --- a/src/libFLAC/stream_decoder.c +++ b/src/libFLAC/stream_decoder.c @@ -1871,6 +1871,10 @@ FLAC__bool read_metadata_cuesheet_(FLAC__StreamDecoder *decoder, FLAC__StreamMet } } } + else { /* obj->num_tracks == 0 */ + FLAC__bitreader_limit_invalidate(decoder->private_->input); + return false; + } return true; } diff --git a/src/share/grabbag/cuesheet.c b/src/share/grabbag/cuesheet.c index 1e1a132b..ab8070b1 100644 --- a/src/share/grabbag/cuesheet.c +++ b/src/share/grabbag/cuesheet.c @@ -626,6 +626,8 @@ void grabbag__cuesheet_emit(FILE *file, const FLAC__StreamMetadata *cuesheet, co fprintf(file, "CATALOG %s\n", cs->media_catalog_number); fprintf(file, "FILE %s\n", file_reference); + FLAC__ASSERT(cs->num_tracks > 0); + for(track_num = 0; track_num < cs->num_tracks-1; track_num++) { const FLAC__StreamMetadata_CueSheet_Track *track = cs->tracks + track_num; -- cgit v1.2.3 From 29d1460a388d303e7780cbaf739b5f925dd82880 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Tue, 18 Apr 2023 11:07:22 +0200 Subject: Add more overflow checks to cuesheet parsing Credit: Oss-Fuzz Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=57315 --- src/share/grabbag/cuesheet.c | 80 +++++++++++++++++++++++++++++++------------- 1 file changed, 57 insertions(+), 23 deletions(-) diff --git a/src/share/grabbag/cuesheet.c b/src/share/grabbag/cuesheet.c index ab8070b1..e3838d7e 100644 --- a/src/share/grabbag/cuesheet.c +++ b/src/share/grabbag/cuesheet.c @@ -24,6 +24,7 @@ #include #include #include +#include #include "FLAC/assert.h" #include "share/compat.h" #include "share/grabbag.h" @@ -44,17 +45,27 @@ void grabbag__cuesheet_frame_to_msf(uint32_t frame, uint32_t *minutes, uint32_t } /* since we only care about values >= 0 or error, returns < 0 for any illegal string, else value */ -static int local__parse_int_(const char *s) +static FLAC__int64 local__parse_int64_(const char *s) { - int ret = 0; + FLAC__int64 ret = 0; char c; if(*s == '\0') return -1; while('\0' != (c = *s++)) - if(c >= '0' && c <= '9') - ret = ret * 10 + (c - '0'); + if(c >= '0' && c <= '9') { + if(ret > (INT64_MAX / 10)) + return false; + else if(ret == (INT64_MAX/10)) { + FLAC__int64 tmp = ret; + ret = ret * 10 + (c - '0'); + if(ret < tmp) + return -1; + } + else + ret = ret * 10 + (c - '0'); + } else return -1; @@ -62,21 +73,12 @@ static int local__parse_int_(const char *s) } /* since we only care about values >= 0 or error, returns < 0 for any illegal string, else value */ -static FLAC__int64 local__parse_int64_(const char *s) +static int local__parse_int_(const char *s) { - FLAC__int64 ret = 0; - char c; - - if(*s == '\0') + FLAC__int64 ret64 = local__parse_int64_(s); + if(ret64 < 0 || ret64 > INT_MAX) return -1; - - while('\0' != (c = *s++)) - if(c >= '0' && c <= '9') - ret = ret * 10 + (c - '0'); - else - return -1; - - return ret; + return ret64; } /* accept minute:second:frame syntax of '[0-9]+:[0-9][0-9]?:[0-9][0-9]?', but max second of 59 and max frame of 74, e.g. 0:0:0, 123:45:67 @@ -94,12 +96,24 @@ static FLAC__int64 local__parse_msf_(const char *s, uint32_t sample_rate) else return -1; while(':' != (c = *s++)) { - if(c >= '0' && c <= '9') - field = field * 10 + (c - '0'); + if(c >= '0' && c <= '9') { + if(field > (INT64_MAX / 10)) + return false; + else if(field == (INT64_MAX/10)) { + FLAC__int64 tmp = field; + field = field * 10 + (c - '0'); + if(field < tmp) + return -1; + } + else + field = field * 10 + (c - '0'); + } else return -1; } + if(field > INT64_MAX / (60 * sample_rate)) + return -1; ret = field * 60 * sample_rate; c = *s++; @@ -121,7 +135,12 @@ static FLAC__int64 local__parse_msf_(const char *s, uint32_t sample_rate) if(field >= 60) return -1; - ret += field * sample_rate; + { + FLAC__int64 tmp = ret; + ret += field * sample_rate; + if(ret < tmp) + return -1; + } c = *s++; if(c >= '0' && c <= '9') @@ -143,7 +162,12 @@ static FLAC__int64 local__parse_msf_(const char *s, uint32_t sample_rate) if(field >= 75) return -1; - ret += field * (sample_rate / 75); + { + FLAC__int64 tmp = ret; + ret += field * (sample_rate / 75); + if(ret < tmp) + return -1; + } return ret; } @@ -164,8 +188,18 @@ static FLAC__int64 local__parse_ms_(const char *s, uint32_t sample_rate) else return -1; while(':' != (c = *s++)) { - if(c >= '0' && c <= '9') - field = field * 10 + (c - '0'); + if(c >= '0' && c <= '9') { + if(field > (INT64_MAX / 10)) + return false; + else if(field == (INT64_MAX/10)) { + FLAC__int64 tmp = field; + field = field * 10 + (c - '0'); + if(field < tmp) + return -1; + } + else + field = field * 10 + (c - '0'); + } else return -1; } -- cgit v1.2.3 From 798fe376eb0a5a2c409fe4aa77f19294be8e5663 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Tue, 18 Apr 2023 14:08:53 +0200 Subject: Error when skip or until are used on a file without streaminfo Credit: Oss-Fuzz Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=58031 --- src/flac/decode.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/flac/decode.c b/src/flac/decode.c index 89f6dbd8..14403b8b 100644 --- a/src/flac/decode.c +++ b/src/flac/decode.c @@ -1178,9 +1178,8 @@ FLAC__StreamDecoderWriteStatus write_callback(const FLAC__StreamDecoder *decoder /* * limit the number of samples to accept based on --until */ - FLAC__ASSERT(!decoder_session->skip_specification->is_relative); /* if we never got the total_samples from the metadata, the skip and until specs would never have been canonicalized, so protect against that: */ - if(decoder_session->skip_specification->is_relative) { + if(decoder_session->skip_specification->is_relative || !decoder_session->got_stream_info) { if(decoder_session->skip_specification->value.samples == 0) /* special case for when no --skip was given */ decoder_session->skip_specification->is_relative = false; /* convert to our meaning of beginning-of-stream */ else { @@ -1188,7 +1187,7 @@ FLAC__StreamDecoderWriteStatus write_callback(const FLAC__StreamDecoder *decoder return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT; } } - if(decoder_session->until_specification->is_relative) { + if(decoder_session->until_specification->is_relative || !decoder_session->got_stream_info) { if(decoder_session->until_specification->value.samples == 0) /* special case for when no --until was given */ decoder_session->until_specification->is_relative = false; /* convert to our meaning of end-of-stream */ else { -- cgit v1.2.3 From d2060f48e5f832aecb43ee074a7071492d05ab3d Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Wed, 19 Apr 2023 11:38:00 +0200 Subject: Fix division by zero when handling sample rate == 0 Credit: Oss-Fuzz Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=58142 --- src/flac/encode.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/flac/encode.c b/src/flac/encode.c index bc71088d..3fff0369 100644 --- a/src/flac/encode.c +++ b/src/flac/encode.c @@ -1951,8 +1951,12 @@ FLAC__bool EncoderSession_init_encoder(EncoderSession *e, encode_options_t optio flac_decoder_data->num_metadata_blocks = j; if(options.padding > 0) p = options.padding; - if(p < 0) - p = e->total_samples_to_encode / sample_rate < 20*60? FLAC_ENCODE__DEFAULT_PADDING : FLAC_ENCODE__DEFAULT_PADDING*8; + if(p < 0) { + if(sample_rate == 0) + p = FLAC_ENCODE__DEFAULT_PADDING; + else + p = e->total_samples_to_encode / sample_rate < 20*60? FLAC_ENCODE__DEFAULT_PADDING : FLAC_ENCODE__DEFAULT_PADDING*8; + } if(p > 0) p += (e->replay_gain ? GRABBAG__REPLAYGAIN_MAX_TAG_SPACE_REQUIRED : 0); p = min(p, (int)((1u << FLAC__STREAM_METADATA_LENGTH_LEN) - 1)); @@ -2015,7 +2019,10 @@ FLAC__bool EncoderSession_init_encoder(EncoderSession *e, encode_options_t optio if(options.padding != 0) { padding.is_last = false; /* the encoder will set this for us */ padding.type = FLAC__METADATA_TYPE_PADDING; - padding.length = (uint32_t)(options.padding>0? options.padding : (e->total_samples_to_encode / sample_rate < 20*60? FLAC_ENCODE__DEFAULT_PADDING : FLAC_ENCODE__DEFAULT_PADDING*8)) + (e->replay_gain ? GRABBAG__REPLAYGAIN_MAX_TAG_SPACE_REQUIRED : 0); + if(sample_rate == 0) + padding.length = (uint32_t)(options.padding>0? options.padding : FLAC_ENCODE__DEFAULT_PADDING) + (e->replay_gain ? GRABBAG__REPLAYGAIN_MAX_TAG_SPACE_REQUIRED : 0); + else + padding.length = (uint32_t)(options.padding>0? options.padding : (e->total_samples_to_encode / sample_rate < 20*60? FLAC_ENCODE__DEFAULT_PADDING : FLAC_ENCODE__DEFAULT_PADDING*8)) + (e->replay_gain ? GRABBAG__REPLAYGAIN_MAX_TAG_SPACE_REQUIRED : 0); padding.length = min(padding.length, (1u << FLAC__STREAM_METADATA_LENGTH_LEN) - 1); static_metadata_append(&static_metadata, &padding, /*needs_delete=*/false); } @@ -2180,14 +2187,13 @@ FLAC__bool convert_to_seek_table_template(const char *requested_seek_points, int if(num_requested_seek_points == 0 && 0 == cuesheet) return true; - if(num_requested_seek_points < 0) { #if FLAC__HAS_OGG - /*@@@@@@ workaround ogg bug: too many seekpoints makes table not fit in one page */ - if(e->use_ogg && e->total_samples_to_encode > 0 && e->total_samples_to_encode / e->info.sample_rate / 10 > 230) - requested_seek_points = "230x;"; - else + if(e->use_ogg) + return true; #endif - requested_seek_points = "10s;"; + + if(num_requested_seek_points < 0) { + requested_seek_points = "10s;"; num_requested_seek_points = 1; } -- cgit v1.2.3 From 9bbdb6be6d5a0eab0cd7388ee0d7669201d25066 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Fri, 21 Apr 2023 20:39:29 +0200 Subject: Do not set brute-force options on fuzzing flac tool These options are already fuzzed with the library fuzzers, using them for the tool will probably not find anything new. This should reduce the number of timeouts during fuzzing --- src/flac/encode.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/flac/encode.c b/src/flac/encode.c index 3fff0369..4b7c8cc0 100644 --- a/src/flac/encode.c +++ b/src/flac/encode.c @@ -2072,19 +2072,25 @@ FLAC__bool EncoderSession_init_encoder(EncoderSession *e, encode_options_t optio } break; case CST_MAX_LPC_ORDER: +#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION FLAC__stream_encoder_set_max_lpc_order(e->encoder, options.compression_settings[ic].value.t_unsigned); +#endif break; case CST_QLP_COEFF_PRECISION: FLAC__stream_encoder_set_qlp_coeff_precision(e->encoder, options.compression_settings[ic].value.t_unsigned); break; case CST_DO_QLP_COEFF_PREC_SEARCH: +#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION FLAC__stream_encoder_set_do_qlp_coeff_prec_search(e->encoder, options.compression_settings[ic].value.t_bool); +#endif break; case CST_DO_ESCAPE_CODING: FLAC__stream_encoder_set_do_escape_coding(e->encoder, options.compression_settings[ic].value.t_bool); break; case CST_DO_EXHAUSTIVE_MODEL_SEARCH: +#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION FLAC__stream_encoder_set_do_exhaustive_model_search(e->encoder, options.compression_settings[ic].value.t_bool); +#endif break; case CST_MIN_RESIDUAL_PARTITION_ORDER: FLAC__stream_encoder_set_min_residual_partition_order(e->encoder, options.compression_settings[ic].value.t_unsigned); -- cgit v1.2.3 From 5008827b64e29c1d0c8c62f92389c43af6b5eccf Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Fri, 21 Apr 2023 20:40:53 +0200 Subject: Remove files generated during fuzzing of flac tool CI-Fuzz occassionally runs out of disk space, and there might be other problems (coverage suddenly vanishing for example) related to disk space issues. This commit should make sure all files generated by the flac tool are removed as soon as they are closed. --- src/flac/analyze.c | 3 +++ src/flac/decode.c | 4 ++++ src/flac/encode.c | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/src/flac/analyze.c b/src/flac/analyze.c index ff1b170d..0f89f69e 100644 --- a/src/flac/analyze.c +++ b/src/flac/analyze.c @@ -245,5 +245,8 @@ FLAC__bool dump_stats(const subframe_stats_t *stats, const char *filename) fprintf(outfile, "pause -1 'waiting...'\n"); fclose(outfile); +#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION + unlink(filename); +#endif return true; } diff --git a/src/flac/decode.c b/src/flac/decode.c index 14403b8b..c5d8fd52 100644 --- a/src/flac/decode.c +++ b/src/flac/decode.c @@ -297,7 +297,11 @@ void DecoderSession_destroy(DecoderSession *d, FLAC__bool error_occurred) } #endif fclose(d->fout); + +#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION + /* Always delete output file when fuzzing */ if(error_occurred) +#endif flac_unlink(d->outfilename); } } diff --git a/src/flac/encode.c b/src/flac/encode.c index 4b7c8cc0..e115d2e4 100644 --- a/src/flac/encode.c +++ b/src/flac/encode.c @@ -1626,6 +1626,11 @@ int EncoderSession_finish_ok(EncoderSession *e, int info_align_carry, int info_a ret = 1; } +#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION + /* Always delete output file when fuzzing */ + flac_unlink(e->outfilename); +#endif + EncoderSession_destroy(e); return ret; -- cgit v1.2.3 From d4daa86167b10774569b6dbe8d69a5df80ccd266 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Sun, 23 Apr 2023 21:06:27 +0200 Subject: Check for bps% 8 != 0 if no streaminfo is present This extends commit c671e1c for cases where streaminfo is not present. Credit: Oss-Fuzz Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=58277 --- src/flac/decode.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/flac/decode.c b/src/flac/decode.c index c5d8fd52..df0f7b3f 100644 --- a/src/flac/decode.c +++ b/src/flac/decode.c @@ -1144,6 +1144,10 @@ FLAC__StreamDecoderWriteStatus write_callback(const FLAC__StreamDecoder *decoder else { /* must not have gotten STREAMINFO, save the bps from the frame header */ FLAC__ASSERT(!decoder_session->got_stream_info); + if(decoder_session->format == FORMAT_RAW && ((decoder_session->bps % 8) != 0 || decoder_session->bps < 4)) { + flac__utils_printf(stderr, 1, "%s: ERROR: bits per sample is %u, must be 8/16/24/32 for raw format output\n", decoder_session->inbasefilename, decoder_session->bps); + return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT; + } decoder_session->bps = bps; } -- cgit v1.2.3 From dd288d2f23bec2a9b984e49011dacea8e071a6b2 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Sun, 23 Apr 2023 21:51:17 +0200 Subject: Do not fuzz apodizations in flac tool fuzzer These are already fuzzed elsewhere, so disable fuzzing in the flac tool fuzzer. --- src/flac/encode.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/flac/encode.c b/src/flac/encode.c index e115d2e4..5d1ee484 100644 --- a/src/flac/encode.c +++ b/src/flac/encode.c @@ -2108,8 +2108,10 @@ FLAC__bool EncoderSession_init_encoder(EncoderSession *e, encode_options_t optio break; } } +#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION if(*apodizations) FLAC__stream_encoder_set_apodization(e->encoder, apodizations); +#endif FLAC__stream_encoder_set_total_samples_estimate(e->encoder, e->total_samples_to_encode); FLAC__stream_encoder_set_metadata(e->encoder, (num_metadata > 0)? metadata : 0, num_metadata); FLAC__stream_encoder_set_limit_min_bitrate(e->encoder, options.limit_min_bitrate); -- cgit v1.2.3 From 3e3b4407aed70d5bf83e72b303d0a989096bdbca Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Mon, 24 Apr 2023 10:47:05 +0200 Subject: Add check for samplerate == 0 when parsing cuesheets Credit: Oss-Fuzz Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=58199 --- src/metaflac/operations_shorthand_cuesheet.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/metaflac/operations_shorthand_cuesheet.c b/src/metaflac/operations_shorthand_cuesheet.c index 99737550..0998b71d 100644 --- a/src/metaflac/operations_shorthand_cuesheet.c +++ b/src/metaflac/operations_shorthand_cuesheet.c @@ -69,6 +69,12 @@ FLAC__bool do_shorthand_operation__cuesheet(const char *filename, FLAC__Metadata return false; } + if(sample_rate == 0) { + flac_fprintf(stderr, "%s: ERROR: cannot parse cuesheet when sample rate is unknown\n", filename); + FLAC__metadata_iterator_delete(iterator); + return false; + } + switch(operation->type) { case OP__IMPORT_CUESHEET_FROM: if(0 != cuesheet) { -- cgit v1.2.3 From 01fb06103d21c199915f0926db44e896f58c07fb Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Mon, 24 Apr 2023 10:53:44 +0200 Subject: Fix mistakes in 29d1460 and simplify Return false was used instead of return -1. Also, overflow is checked with signed int, which triggers the undefined behaviour sanitizer. Instead, be a little more strict, such large values aren't useful in this context anyway. Credit: Oss-Fuzz Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=58268 --- src/share/grabbag/cuesheet.c | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/src/share/grabbag/cuesheet.c b/src/share/grabbag/cuesheet.c index e3838d7e..40e5f930 100644 --- a/src/share/grabbag/cuesheet.c +++ b/src/share/grabbag/cuesheet.c @@ -55,14 +55,8 @@ static FLAC__int64 local__parse_int64_(const char *s) while('\0' != (c = *s++)) if(c >= '0' && c <= '9') { - if(ret > (INT64_MAX / 10)) - return false; - else if(ret == (INT64_MAX/10)) { - FLAC__int64 tmp = ret; - ret = ret * 10 + (c - '0'); - if(ret < tmp) - return -1; - } + if(ret >= (INT64_MAX / 10)) + return -1; else ret = ret * 10 + (c - '0'); } @@ -97,14 +91,8 @@ static FLAC__int64 local__parse_msf_(const char *s, uint32_t sample_rate) return -1; while(':' != (c = *s++)) { if(c >= '0' && c <= '9') { - if(field > (INT64_MAX / 10)) - return false; - else if(field == (INT64_MAX/10)) { - FLAC__int64 tmp = field; - field = field * 10 + (c - '0'); - if(field < tmp) - return -1; - } + if(field >= (INT64_MAX / 10)) + return -1; else field = field * 10 + (c - '0'); } @@ -112,7 +100,7 @@ static FLAC__int64 local__parse_msf_(const char *s, uint32_t sample_rate) return -1; } - if(field > INT64_MAX / (60 * sample_rate)) + if(field >= INT64_MAX / (60 * sample_rate)) return -1; ret = field * 60 * sample_rate; @@ -189,14 +177,8 @@ static FLAC__int64 local__parse_ms_(const char *s, uint32_t sample_rate) return -1; while(':' != (c = *s++)) { if(c >= '0' && c <= '9') { - if(field > (INT64_MAX / 10)) - return false; - else if(field == (INT64_MAX/10)) { - FLAC__int64 tmp = field; - field = field * 10 + (c - '0'); - if(field < tmp) - return -1; - } + if(field >= (INT64_MAX / 10)) + return -1; else field = field * 10 + (c - '0'); } -- cgit v1.2.3 From 147cfc8df424b3b4fe6cc15a37d8ab9f3320dcd6 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Mon, 24 Apr 2023 16:06:18 +0200 Subject: Do not use main output buffer when outputting padding frames Currently, when the decoder finds that it is missing some data, it will fill that up with silence. However, it uses the output buffer for that, overwriting the last decoded data. Therefore, more data is dropped than is necessary. This also leads to a heap use after free when a buffer resize is needed to accomodate the silence data and the frame data is used for analysis Credit: Oss-Fuzz Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=57354 --- src/libFLAC/stream_decoder.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/src/libFLAC/stream_decoder.c b/src/libFLAC/stream_decoder.c index 8ce6d605..104d0d5d 100644 --- a/src/libFLAC/stream_decoder.c +++ b/src/libFLAC/stream_decoder.c @@ -2157,10 +2157,20 @@ FLAC__bool read_frame_(FLAC__StreamDecoder *decoder, FLAC__bool *got_a_frame, FL decoder->private_->last_frame.header.channels == decoder->private_->frame.header.channels && decoder->private_->last_frame.header.bits_per_sample == decoder->private_->frame.header.bits_per_sample && decoder->private_->last_frame.header.blocksize >= 16) { - FLAC__Frame empty_frame; + FLAC__int32 * empty_buffer[FLAC__MAX_CHANNELS] = {NULL}; empty_frame.header = decoder->private_->last_frame.header; empty_frame.footer.crc = 0; + for(i = 0; i < empty_frame.header.channels; i++) { + empty_buffer[i] = safe_calloc_(empty_frame.header.blocksize, sizeof(FLAC__int32)); + if(empty_buffer[i] == NULL) { + for(i = 0; i < empty_frame.header.channels; i++) + if(empty_buffer[i] != NULL) + free(empty_buffer[i]); + decoder->protected_->state = FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR; + return false; + } + } /* No repairs larger than 5 seconds or 50 frames are made, to not * unexpectedly create enormous files when one of the headers was * corrupt after all */ @@ -2178,21 +2188,24 @@ FLAC__bool read_frame_(FLAC__StreamDecoder *decoder, FLAC__bool *got_a_frame, FL FLAC__ASSERT(empty_frame.header.number_type == FLAC__FRAME_NUMBER_TYPE_SAMPLE_NUMBER); decoder->private_->samples_decoded = empty_frame.header.number.sample_number + empty_frame.header.blocksize; - if(!allocate_output_(decoder, empty_frame.header.blocksize, empty_frame.header.channels, empty_frame.header.bits_per_sample)) - return false; - for(channel = 0; channel < empty_frame.header.channels; channel++) { empty_frame.subframes[channel].type = FLAC__SUBFRAME_TYPE_CONSTANT; empty_frame.subframes[channel].data.constant.value = 0; empty_frame.subframes[channel].wasted_bits = 0; - memset(decoder->private_->output[channel], 0, sizeof(FLAC__int32) * empty_frame.header.blocksize); } - if(write_audio_frame_to_client_(decoder, &empty_frame, (const FLAC__int32 * const *)decoder->private_->output) != FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE) { + if(write_audio_frame_to_client_(decoder, &empty_frame, (const FLAC__int32 * const *)empty_buffer) != FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE) { decoder->protected_->state = FLAC__STREAM_DECODER_ABORTED; + for(i = 0; i < empty_frame.header.channels; i++) + if(empty_buffer[i] != NULL) + free(empty_buffer[i]); return false; } } + for(i = 0; i < empty_frame.header.channels; i++) + if(empty_buffer[i] != NULL) + free(empty_buffer[i]); + } } } -- cgit v1.2.3 From c7861aa84644cb97e44cca3e37d3939ad1350a43 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Fri, 28 Apr 2023 08:48:08 +0200 Subject: Also apply shift to raw data This change only applies when bitdepth changes halfway a stream. It is more a technicality that needs fixing because of fuzzing than an actual problem Credit: Oss-Fuzz Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=58357 --- src/flac/decode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/flac/decode.c b/src/flac/decode.c index df0f7b3f..ff0b0d94 100644 --- a/src/flac/decode.c +++ b/src/flac/decode.c @@ -1099,7 +1099,7 @@ FLAC__StreamDecoderWriteStatus write_callback(const FLAC__StreamDecoder *decoder DecoderSession *decoder_session = (DecoderSession*)client_data; FILE *fout = decoder_session->fout; const uint32_t bps = frame->header.bits_per_sample, channels = frame->header.channels; - const uint32_t shift = (decoder_session->format != FORMAT_RAW && (bps%8))? 8-(bps%8): 0; + const uint32_t shift = (bps%8)? 8-(bps%8): 0; FLAC__bool is_big_endian = ( (decoder_session->format == FORMAT_AIFF || (decoder_session->format == FORMAT_AIFF_C && decoder_session->subformat == SUBFORMAT_AIFF_C_NONE)) ? true : ( decoder_session->format == FORMAT_WAVE || decoder_session->format == FORMAT_WAVE64 || decoder_session->format == FORMAT_RF64 || (decoder_session->format == FORMAT_AIFF_C && decoder_session->subformat == SUBFORMAT_AIFF_C_SOWT) ? false : -- cgit v1.2.3 From 763e185671817a55cb41405b787dc411f4935901 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Fri, 28 Apr 2023 08:57:18 +0200 Subject: Hide unreproducible bug that is probably harmless Issue https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=56395 remains unreproducible to me, and the whole problem doesn't seem to make any sense. Even downloading the affected build and running it locally doesn't reproduce the problem. As this is probably a harmless bug (if it is a bug) that is triggered by an assert but is handled anyway, I'm hiding the assert so the handling is fuzzed when the assert is removed, as in production code. --- src/flac/encode.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/flac/encode.c b/src/flac/encode.c index 5d1ee484..5c03ec60 100644 --- a/src/flac/encode.c +++ b/src/flac/encode.c @@ -1520,7 +1520,9 @@ FLAC__bool EncoderSession_construct(EncoderSession *e, encode_options_t options, e->fmt.flac.client_data.fatal_error = false; break; default: +#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION FLAC__ASSERT(0); +#endif /* double protection */ return false; } -- cgit v1.2.3 From ec4e5aa95dd8ba0f65b8bbd540d54f73b28acc2a Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Fri, 28 Apr 2023 12:00:54 +0200 Subject: Add flac tool fuzzer dictionary --- oss-fuzz/fuzzer_tool_flac.dict | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 oss-fuzz/fuzzer_tool_flac.dict diff --git a/oss-fuzz/fuzzer_tool_flac.dict b/oss-fuzz/fuzzer_tool_flac.dict new file mode 100644 index 00000000..3ef9be51 --- /dev/null +++ b/oss-fuzz/fuzzer_tool_flac.dict @@ -0,0 +1,19 @@ +"--keep-foreign-metadata-if-present" +"--replay-gain" +"--apply-replaygain-which-is-not-lossless" + +"--force-raw-format" +"--force-aiff-format" +"--force-rf64-format" +"--force-wave64-format" +"--force-aiff-c-sowt-format" +"--force-aiff-c-none-format" +"--force-legacy-wave-format" +"--force-extensible-wave-format" + +"--endian=big" +"--sample-rate=1" +"--channels=1" +"--bps=32" +"--sign=unsigned" + -- cgit v1.2.3 From 189cbaabd88c170882d707a6f5be0d8e17b22537 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Fri, 28 Apr 2023 13:37:59 +0200 Subject: Only invalidate last seen framesync when actually emptying buffer The last seen framesync in the bitreader was invalidated when reading new data in. However, data only leaved the buffer when more than one word has been fully read. When an invalid frame is read and reading is aborted within less than a wordlength because of reaching end-of-stream, the read_from_client had invalidated the last seen framesync, causing rewinding to the start of the bitreader. This causes an infinite loop, syncing on the same pattern every time. --- src/libFLAC/bitreader.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libFLAC/bitreader.c b/src/libFLAC/bitreader.c index af878e06..e6e60abc 100644 --- a/src/libFLAC/bitreader.c +++ b/src/libFLAC/bitreader.c @@ -164,11 +164,11 @@ static FLAC__bool bitreader_read_from_client_(FLAC__BitReader *br) brword preswap_backup; #endif - /* invalidate last seen framesync */ - br->last_seen_framesync = -1; - /* first shift the unconsumed buffer data toward the front as much as possible */ if(br->consumed_words > 0) { + /* invalidate last seen framesync */ + br->last_seen_framesync = -1; + crc16_update_block_(br); /* CRC consumed words */ start = br->consumed_words; -- cgit v1.2.3 From 645d651e83dcd1b8f25e9586e9f53270fd9ede60 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Fri, 28 Apr 2023 19:41:30 +0200 Subject: Only unset 'first' after successful execution 'first' was handed to flac__encode_file on the first file of a set, to let that function know replaygain needs to be initialized. However, when processing of the first file fails, the second file uses replaygain uninitialized. --- src/flac/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/flac/main.c b/src/flac/main.c index 3c19f1a9..2bc30355 100644 --- a/src/flac/main.c +++ b/src/flac/main.c @@ -543,8 +543,10 @@ int do_it(void) for(i = 0, retval = 0; i < option_values.num_files; i++) { if(0 == strcmp(option_values.filenames[i], "-") && !first) continue; - retval |= encode_file(option_values.filenames[i], first, i == (option_values.num_files-1)); - first = false; + if(encode_file(option_values.filenames[i], first, i == (option_values.num_files-1))) + retval = 1; + else + first = false; } if(option_values.replay_gain && retval == 0) { float album_gain, album_peak; -- cgit v1.2.3 From 072cfdf5b274579f00b21c995a4051e21210b195 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Mon, 1 May 2023 19:39:20 +0200 Subject: Try to fix unreproducible memory leak in metaflac It seems the fuzzer tries to add a picture file, for which the file was available during fuzzing but not during reproducing. This fix seems the most logical place it was failing. Credit: Oss-Fuzz Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=58371 --- src/metaflac/operations_shorthand_picture.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/metaflac/operations_shorthand_picture.c b/src/metaflac/operations_shorthand_picture.c index 1c5ecf40..91af779e 100644 --- a/src/metaflac/operations_shorthand_picture.c +++ b/src/metaflac/operations_shorthand_picture.c @@ -136,6 +136,8 @@ FLAC__bool import_pic_from(const char *filename, FLAC__StreamMetadata **picture, if(!FLAC__format_picture_is_legal(&(*picture)->data.picture, &error_message)) { flac_fprintf(stderr, "%s: ERROR: new PICTURE block for \"%s\" is illegal: %s\n", filename, specification, error_message); + FLAC__metadata_object_delete(*picture); + *picture = 0; return false; } -- cgit v1.2.3 From 4f81ef46c9925dfbe5d77e535a24bb7b56f4b543 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Mon, 1 May 2023 22:12:17 +0200 Subject: Handle case where lookahead length is larger than read size ... ... for raw input This can happen when --until is used on a very short raw file. Credit: Oss-Fuzz Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=58536 --- src/flac/encode.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/flac/encode.c b/src/flac/encode.c index 5c03ec60..76fc0a07 100644 --- a/src/flac/encode.c +++ b/src/flac/encode.c @@ -1265,10 +1265,18 @@ int flac__encode_file(FILE *infile, FLAC__off_t infilesize, const char *infilena wanted = (size_t) min((FLAC__uint64)wanted, max_input_bytes - total_input_bytes_read); if(lookahead_length > 0) { - FLAC__ASSERT(lookahead_length <= wanted); - memcpy(ubuffer.u8, lookahead, lookahead_length); - wanted -= lookahead_length; - bytes_read = lookahead_length; + if(lookahead_length <= wanted) { + memcpy(ubuffer.u8, lookahead, lookahead_length); + wanted -= lookahead_length; + bytes_read = lookahead_length; + } + else { + /* This happens when --until is used on a very short file */ + FLAC__ASSERT(lookahead_length < CHUNK_OF_SAMPLES * encoder_session.info.bytes_per_wide_sample); + memcpy(ubuffer.u8, lookahead, wanted); + wanted = 0; + bytes_read = wanted; + } if(wanted > 0) { bytes_read += fread(ubuffer.u8+lookahead_length, sizeof(uint8_t), wanted, infile); if(ferror(infile)) { -- cgit v1.2.3 From 946c25de7654f7ceceaba5c17203ccdca0758537 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Tue, 2 May 2023 19:22:44 +0200 Subject: Check for overflow when converting skip and until to samples Credit: Oss-Fuzz Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=57409 --- src/flac/decode.c | 11 +++++++++-- src/flac/encode.c | 10 ++++++++-- src/flac/utils.c | 8 ++++++-- src/flac/utils.h | 2 +- 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/src/flac/decode.c b/src/flac/decode.c index ff0b0d94..d874b4b8 100644 --- a/src/flac/decode.c +++ b/src/flac/decode.c @@ -590,7 +590,10 @@ int DecoderSession_finish_error(DecoderSession *d) FLAC__bool canonicalize_until_specification(utils__SkipUntilSpecification *spec, const char *inbasefilename, uint32_t sample_rate, FLAC__uint64 skip, FLAC__uint64 total_samples_in_input) { /* convert from mm:ss.sss to sample number if necessary */ - flac__utils_canonicalize_skip_until_specification(spec, sample_rate); + if(!flac__utils_canonicalize_skip_until_specification(spec, sample_rate)) { + flac__utils_printf(stderr, 1, "%s: ERROR, value of --until is too large\n", inbasefilename); + return false; + } /* special case: if "--until=-0", use the special value '0' to mean "end-of-stream" */ if(spec->is_relative && spec->value.samples == 0) { @@ -1459,7 +1462,11 @@ void metadata_callback(const FLAC__StreamDecoder *decoder, const FLAC__StreamMet decoder_session->channels = metadata->data.stream_info.channels; decoder_session->sample_rate = metadata->data.stream_info.sample_rate; - flac__utils_canonicalize_skip_until_specification(decoder_session->skip_specification, decoder_session->sample_rate); + if(!flac__utils_canonicalize_skip_until_specification(decoder_session->skip_specification, decoder_session->sample_rate)) { + flac__utils_printf(stderr, 1, "%s: ERROR, value of --skip is too large\n", decoder_session->inbasefilename); + decoder_session->abort_flag = true; + return; + } FLAC__ASSERT(decoder_session->skip_specification->value.samples >= 0); skip = (FLAC__uint64)decoder_session->skip_specification->value.samples; diff --git a/src/flac/encode.c b/src/flac/encode.c index 76fc0a07..c2b14e50 100644 --- a/src/flac/encode.c +++ b/src/flac/encode.c @@ -1016,7 +1016,10 @@ int flac__encode_file(FILE *infile, FLAC__off_t infilesize, const char *infilena * now that we know the sample rate, canonicalize the * --skip string to an absolute sample number: */ - flac__utils_canonicalize_skip_until_specification(&options.skip_specification, encoder_session.info.sample_rate); + if(!flac__utils_canonicalize_skip_until_specification(&options.skip_specification, encoder_session.info.sample_rate)) { + flac__utils_printf(stderr, 1, "%s: ERROR: value of --skip is too large\n", encoder_session.inbasefilename, encoder_session.info.bits_per_sample-encoder_session.info.shift); + return EncoderSession_finish_error(&encoder_session); + } FLAC__ASSERT(options.skip_specification.value.samples >= 0); skip = (FLAC__uint64)options.skip_specification.value.samples; FLAC__ASSERT(!options.sector_align || (options.format != FORMAT_FLAC && options.format != FORMAT_OGGFLAC && skip == 0)); @@ -2255,7 +2258,10 @@ FLAC__bool convert_to_seek_table_template(const char *requested_seek_points, int FLAC__bool canonicalize_until_specification(utils__SkipUntilSpecification *spec, const char *inbasefilename, uint32_t sample_rate, FLAC__uint64 skip, FLAC__uint64 total_samples_in_input) { /* convert from mm:ss.sss to sample number if necessary */ - flac__utils_canonicalize_skip_until_specification(spec, sample_rate); + if(!flac__utils_canonicalize_skip_until_specification(spec, sample_rate)) { + flac__utils_printf(stderr, 1, "%s: ERROR, value of --until is too large\n", inbasefilename); + return false; + } /* special case: if "--until=-0", use the special value '0' to mean "end-of-stream" */ if(spec->is_relative && spec->value.samples == 0) { diff --git a/src/flac/utils.c b/src/flac/utils.c index e043ee7c..da39bd4f 100644 --- a/src/flac/utils.c +++ b/src/flac/utils.c @@ -330,13 +330,17 @@ FLAC__bool flac__utils_parse_skip_until_specification(const char *s, utils__Skip return true; } -void flac__utils_canonicalize_skip_until_specification(utils__SkipUntilSpecification *spec, uint32_t sample_rate) +FLAC__bool flac__utils_canonicalize_skip_until_specification(utils__SkipUntilSpecification *spec, uint32_t sample_rate) { FLAC__ASSERT(0 != spec); if(!spec->value_is_samples) { - spec->value.samples = (FLAC__int64)(spec->value.seconds * (double)sample_rate); + double samples = spec->value.seconds * (double)sample_rate; + if(samples >= (double)INT64_MAX || samples <= (double)INT64_MIN) + return false; + spec->value.samples = (FLAC__int64)(samples); spec->value_is_samples = true; } + return true; } FLAC__bool flac__utils_parse_cue_specification(const char *s, utils__CueSpecification *spec) diff --git a/src/flac/utils.h b/src/flac/utils.h index 2c1f1536..ec87f567 100644 --- a/src/flac/utils.h +++ b/src/flac/utils.h @@ -66,7 +66,7 @@ void stats_print_name(int level, const char *name); void stats_print_info(int level, const char *format, ...); FLAC__bool flac__utils_parse_skip_until_specification(const char *s, utils__SkipUntilSpecification *spec); -void flac__utils_canonicalize_skip_until_specification(utils__SkipUntilSpecification *spec, uint32_t sample_rate); +FLAC__bool flac__utils_canonicalize_skip_until_specification(utils__SkipUntilSpecification *spec, uint32_t sample_rate); FLAC__bool flac__utils_parse_cue_specification(const char *s, utils__CueSpecification *spec); void flac__utils_canonicalize_cue_specification(const utils__CueSpecification *cue_spec, const FLAC__StreamMetadata_CueSheet *cuesheet, FLAC__uint64 total_samples, utils__SkipUntilSpecification *skip_spec, utils__SkipUntilSpecification *until_spec); -- cgit v1.2.3 From 2e14bc19a99522c383064b6ee44237b67707bafe Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Tue, 2 May 2023 20:06:55 +0200 Subject: Reject floating point value with exponent == 63 This prevent shifting with a negative number (which is undefined behaviour) and such values are too large to process anyway. Credit: Oss-Fuzz Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=58077 --- src/flac/encode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/flac/encode.c b/src/flac/encode.c index c2b14e50..32cf479d 100644 --- a/src/flac/encode.c +++ b/src/flac/encode.c @@ -2911,7 +2911,7 @@ FLAC__bool read_sane_extended(FILE *f, FLAC__uint32 *val, const char *fn) return false; e = ((FLAC__uint16)(buf[0])<<8 | (FLAC__uint16)(buf[1]))-0x3FFF; shift = 63-e; - if((buf[0]>>7)==1U || e<0 || e>63) { + if((buf[0]>>7)==1U || e<0 || e>=63) { flac__utils_printf(stderr, 1, "%s: ERROR: invalid floating-point value\n", fn); return false; } -- cgit v1.2.3 From db57fe14c23ca25a465513958594669ce2fba6b7 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Thu, 4 May 2023 09:04:37 +0200 Subject: Revert exclusion of stdin code for fuzzer_tool_metaflac When building the tool fuzzers, I excluded some code reading from stdin because it caused blocking of the fuzzer (i.e. timeouts). However, the fuzzer now handles stdin, so these exclusions can be removed --- src/metaflac/operations_shorthand_cuesheet.c | 2 -- src/metaflac/operations_shorthand_vorbiscomment.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/src/metaflac/operations_shorthand_cuesheet.c b/src/metaflac/operations_shorthand_cuesheet.c index 0998b71d..3cf6b214 100644 --- a/src/metaflac/operations_shorthand_cuesheet.c +++ b/src/metaflac/operations_shorthand_cuesheet.c @@ -128,11 +128,9 @@ FLAC__bool import_cs_from(const char *filename, FLAC__StreamMetadata **cuesheet, flac_fprintf(stderr, "%s: ERROR: empty import file name\n", filename); return false; } -#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION if(0 == strcmp(cs_filename, "-")) f = stdin; else -#endif f = flac_fopen(cs_filename, "r"); if(0 == f) { diff --git a/src/metaflac/operations_shorthand_vorbiscomment.c b/src/metaflac/operations_shorthand_vorbiscomment.c index c690fddf..bf135d4b 100644 --- a/src/metaflac/operations_shorthand_vorbiscomment.c +++ b/src/metaflac/operations_shorthand_vorbiscomment.c @@ -347,11 +347,9 @@ FLAC__bool import_vc_from(const char *filename, FLAC__StreamMetadata *block, con flac_fprintf(stderr, "%s: ERROR: empty import file name\n", filename); return false; } -#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION if(0 == strcmp(vc_filename->value, "-")) f = stdin; else -#endif f = flac_fopen(vc_filename->value, "r"); if(0 == f) { -- cgit v1.2.3 From 321c4aeb22966b664d933ad8d9fd18ca140dbd5e Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Thu, 4 May 2023 11:29:14 +0200 Subject: Remove files generated during fuzzing of metaflac tool Similar to commit 5008827 --- src/metaflac/operations_shorthand_cuesheet.c | 5 +++++ src/metaflac/operations_shorthand_picture.c | 6 ++++++ src/metaflac/operations_shorthand_vorbiscomment.c | 7 +++++++ 3 files changed, 18 insertions(+) diff --git a/src/metaflac/operations_shorthand_cuesheet.c b/src/metaflac/operations_shorthand_cuesheet.c index 3cf6b214..77390015 100644 --- a/src/metaflac/operations_shorthand_cuesheet.c +++ b/src/metaflac/operations_shorthand_cuesheet.c @@ -216,6 +216,11 @@ FLAC__bool export_cs_to(const char *filename, const FLAC__StreamMetadata *cueshe if(f != stdout) fclose(f); +#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION + /* Delete output file when fuzzing */ + if(f != stdout) + flac_unlink(cs_filename); +#endif return true; } diff --git a/src/metaflac/operations_shorthand_picture.c b/src/metaflac/operations_shorthand_picture.c index 91af779e..10a5e786 100644 --- a/src/metaflac/operations_shorthand_picture.c +++ b/src/metaflac/operations_shorthand_picture.c @@ -174,5 +174,11 @@ FLAC__bool export_pic_to(const char *filename, const FLAC__StreamMetadata *pictu if(f != stdout) fclose(f); +#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION + /* Delete output file when fuzzing */ + if(f != stdout) + flac_unlink(pic_filename); +#endif + return true; } diff --git a/src/metaflac/operations_shorthand_vorbiscomment.c b/src/metaflac/operations_shorthand_vorbiscomment.c index bf135d4b..5a5ca8f4 100644 --- a/src/metaflac/operations_shorthand_vorbiscomment.c +++ b/src/metaflac/operations_shorthand_vorbiscomment.c @@ -419,5 +419,12 @@ FLAC__bool export_vc_to(const char *filename, FLAC__StreamMetadata *block, const if(f != stdout) fclose(f); + +#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION + /* Delete output file when fuzzing */ + if(f != stdout) + flac_unlink(vc_filename->value); +#endif + return ret; } -- cgit v1.2.3 From af6df3b9532ec88ef6e2a8cfa4b84f5ae7cdb06e Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Thu, 4 May 2023 14:58:48 +0200 Subject: Fix cuesheet parsing code skipping a digit The code parsing cuepoints of the form MM:SS.SS, which is only allowed for non-CDDA, had a bug where the first S of the above template was skipped. That meant that 00:12.34 was parsed as 00:02.34. This is not covered in the test suite, but fuzzing stumbled on it as 00: as input made the parser skip the string- terminating nul. Credit: Oss-Fuzz Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=57320 --- src/share/grabbag/cuesheet.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/share/grabbag/cuesheet.c b/src/share/grabbag/cuesheet.c index 40e5f930..f6300c67 100644 --- a/src/share/grabbag/cuesheet.c +++ b/src/share/grabbag/cuesheet.c @@ -188,7 +188,6 @@ static FLAC__int64 local__parse_ms_(const char *s, uint32_t sample_rate) ret = field * 60 * sample_rate; - s++; /* skip the ':' */ if(strspn(s, "0123456789.") != strlen(s)) return -1; x = strtod(s, &end); -- cgit v1.2.3 From 365c7aa92e19fde2edd0642133825e62ecc2581c Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Thu, 4 May 2023 15:40:58 +0200 Subject: Add another check for overflow in cuesheet parsing code Credit: Oss-Fuzz Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=58406 --- src/share/grabbag/cuesheet.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/share/grabbag/cuesheet.c b/src/share/grabbag/cuesheet.c index f6300c67..819b516f 100644 --- a/src/share/grabbag/cuesheet.c +++ b/src/share/grabbag/cuesheet.c @@ -186,6 +186,8 @@ static FLAC__int64 local__parse_ms_(const char *s, uint32_t sample_rate) return -1; } + if(field >= INT64_MAX / (60 * sample_rate)) + return -1; ret = field * 60 * sample_rate; if(strspn(s, "0123456789.") != strlen(s)) -- cgit v1.2.3 From 1b92b86ac9258b822edbca5043f4c208dc5448bf Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Thu, 4 May 2023 16:19:00 +0200 Subject: Check for samplerate != 0 before dividing by it Credit: Oss-Fuzz Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=58199 --- src/share/grabbag/cuesheet.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/share/grabbag/cuesheet.c b/src/share/grabbag/cuesheet.c index 819b516f..c6bf50ef 100644 --- a/src/share/grabbag/cuesheet.c +++ b/src/share/grabbag/cuesheet.c @@ -84,6 +84,9 @@ static FLAC__int64 local__parse_msf_(const char *s, uint32_t sample_rate) FLAC__int64 ret, field; char c; + if(sample_rate == 0) + return -1; + c = *s++; if(c >= '0' && c <= '9') field = (c - '0'); @@ -170,6 +173,9 @@ static FLAC__int64 local__parse_ms_(const char *s, uint32_t sample_rate) double x; char c, *end; + if(sample_rate == 0) + return -1; + c = *s++; if(c >= '0' && c <= '9') field = (c - '0'); -- cgit v1.2.3 From 4caaef6bf4189250b2e7a9038261e2ff0da86554 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Fri, 5 May 2023 09:20:19 +0200 Subject: Fix compilation of getopt1.c on Intel Compiler with LLVM backend This mirrors a change in 2005 to the GCC getopt1.c. --- src/share/getopt/getopt1.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/share/getopt/getopt1.c b/src/share/getopt/getopt1.c index e6f98f9d..fc526784 100644 --- a/src/share/getopt/getopt1.c +++ b/src/share/getopt/getopt1.c @@ -36,9 +36,6 @@ # include #endif -#include "share/getopt.h" -/*[JEC] was:#include "getopt.h"*/ - #if !defined __STDC__ || !__STDC__ /* This is a separate conditional since some stdc systems reject `defined (const)'. */ @@ -49,6 +46,9 @@ #include +#include "share/getopt.h" +/*[JEC] was:#include "getopt.h"*/ + /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling -- cgit v1.2.3 From 183b22ac320c5e59f1d14b0fda395cecad38b932 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Sun, 7 May 2023 21:21:23 +0200 Subject: When outputting partial frame, emulate verbatim frame After seeking, a partial frame is passed to the write callback. The FLAC__Frame passed there only has its blocksize and sample number changed to accomodate. This results in several 'rules' being violated. For example, the predictor order can be larger than the blocksize. This caused integer underflow in the analysis output of the flac command line program, causing heap overflow. Also, the output analysis data is junk, because the residual and rice parameters are not changed accordingly, as this would violate other things that are otherwise given, like the number of rice partitions being a power of 2. To remedy this, a FLAC__Frame is now output stating that all subframes are of the verbatim type, which has no restrictions like fixed and lpc subframes have. A better remedy will have to wait to the next API change, to introduce a few new subframe types for this case and the case of conveying an unreadable frame. Credit: Oss-Fuzz Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=58481 --- src/libFLAC/stream_decoder.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libFLAC/stream_decoder.c b/src/libFLAC/stream_decoder.c index 104d0d5d..400aef14 100644 --- a/src/libFLAC/stream_decoder.c +++ b/src/libFLAC/stream_decoder.c @@ -3227,8 +3227,12 @@ FLAC__StreamDecoderWriteStatus write_audio_frame_to_client_(FLAC__StreamDecoder if(delta > 0) { uint32_t channel; const FLAC__int32 *newbuffer[FLAC__MAX_CHANNELS]; - for(channel = 0; channel < frame->header.channels; channel++) + for(channel = 0; channel < frame->header.channels; channel++) { newbuffer[channel] = buffer[channel] + delta; + decoder->private_->last_frame.subframes[channel].type = FLAC__SUBFRAME_TYPE_VERBATIM; + decoder->private_->last_frame.subframes[channel].data.verbatim.data_type = FLAC__VERBATIM_SUBFRAME_DATA_TYPE_INT32; + decoder->private_->last_frame.subframes[channel].data.verbatim.data.int32 = newbuffer[channel]; + } decoder->private_->last_frame.header.blocksize -= delta; decoder->private_->last_frame.header.number.sample_number += (FLAC__uint64)delta; /* write the relevant samples */ -- cgit v1.2.3 From ebc2a696973f319c045b9bab87a69b84af7fce9e Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Sun, 7 May 2023 15:44:12 +0200 Subject: Fix mistake in eba4b6f and add check to seektable_is_legal Credit: Oss-Fuzz Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=58546 --- src/libFLAC/format.c | 3 +++ src/libFLAC/metadata_object.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libFLAC/format.c b/src/libFLAC/format.c index e434dd73..0c7ca0f6 100644 --- a/src/libFLAC/format.c +++ b/src/libFLAC/format.c @@ -247,6 +247,9 @@ FLAC_API FLAC__bool FLAC__format_seektable_is_legal(const FLAC__StreamMetadata_S FLAC__ASSERT(0 != seek_table); + if((FLAC__uint64)(seek_table->num_points) * FLAC__STREAM_METADATA_SEEKPOINT_LENGTH >= (1u << FLAC__STREAM_METADATA_LENGTH_LEN)) + return false; + for(i = 0; i < seek_table->num_points; i++) { if(got_prev) { if( diff --git a/src/libFLAC/metadata_object.c b/src/libFLAC/metadata_object.c index b7e89549..95656697 100644 --- a/src/libFLAC/metadata_object.c +++ b/src/libFLAC/metadata_object.c @@ -931,7 +931,7 @@ FLAC_API FLAC__bool FLAC__metadata_object_seektable_resize_points(FLAC__StreamMe FLAC__ASSERT(object != NULL); FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_SEEKTABLE); - if(new_num_points > ((2 << FLAC__STREAM_METADATA_LENGTH_LEN ) / FLAC__STREAM_METADATA_SEEKPOINT_LENGTH)) + if((FLAC__uint64)(new_num_points) * FLAC__STREAM_METADATA_SEEKPOINT_LENGTH >= (1u << FLAC__STREAM_METADATA_LENGTH_LEN)) return false; if (object->data.seek_table.points == 0) { -- cgit v1.2.3 From afad04f0a91e9c06f89eacfae496356a16762358 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Mon, 8 May 2023 16:26:22 +0200 Subject: Fix undefined shift Credit: Oss-Fuzz Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=58602 --- src/flac/encode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/flac/encode.c b/src/flac/encode.c index 32cf479d..c6755817 100644 --- a/src/flac/encode.c +++ b/src/flac/encode.c @@ -2425,7 +2425,7 @@ FLAC__bool format_input(FLAC__int32 *dest[], uint32_t wide_samples, FLAC__bool i uint32_t t; t = ubuffer.u8[b]; t |= (uint32_t)(ubuffer.u8[b+1]) << 8; - t |= (int32_t)(ubuffer.s8[b+2]) << 16; + t |= (uint32_t)((int32_t)(ubuffer.s8[b+2])) << 16; out[channel][wide_sample] = t; b += 3*channels; } -- cgit v1.2.3 From 22fffdceb86f019a57d5122aeaac2829812d0b54 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Mon, 8 May 2023 17:04:59 +0200 Subject: Check for overflow when multiplying skip samples with sample size Credit: Oss-Fuzz Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=58606 --- include/share/compat.h | 4 ++++ src/flac/encode.c | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/include/share/compat.h b/include/share/compat.h index 7a865153..5ef5524a 100644 --- a/include/share/compat.h +++ b/include/share/compat.h @@ -52,6 +52,7 @@ #if defined _MSC_VER || defined __BORLANDC__ || defined __MINGW32__ #include /* for off_t */ #define FLAC__off_t __int64 /* use this instead of off_t to fix the 2 GB limit */ +#define FLAC__OFF_T_MAX INT64_MAX #if !defined __MINGW32__ #define fseeko _fseeki64 #define ftello _ftelli64 @@ -63,8 +64,11 @@ #endif #else #define FLAC__off_t off_t +#define FLAC__OFF_T_MAX OFF_T_MAX #endif + + #ifdef HAVE_INTTYPES_H #define __STDC_FORMAT_MACROS #include diff --git a/src/flac/encode.c b/src/flac/encode.c index c6755817..b8f5207a 100644 --- a/src/flac/encode.c +++ b/src/flac/encode.c @@ -1038,6 +1038,11 @@ int flac__encode_file(FILE *infile, FLAC__off_t infilesize, const char *infilena /* adjust encoding parameters based on skip and until values */ switch(options.format) { case FORMAT_RAW: + FLAC__ASSERT(sizeof(FLAC__off_t) == 8); + if(skip >= INT64_MAX / encoder_session.info.bytes_per_wide_sample) { + flac__utils_printf(stderr, 1, "%s: ERROR: value of --skip is too large\n", encoder_session.inbasefilename, encoder_session.info.bits_per_sample-encoder_session.info.shift); + return EncoderSession_finish_error(&encoder_session); + } infilesize -= (FLAC__off_t)skip * encoder_session.info.bytes_per_wide_sample; encoder_session.total_samples_to_encode = total_samples_in_input - skip; break; @@ -1046,6 +1051,11 @@ int flac__encode_file(FILE *infile, FLAC__off_t infilesize, const char *infilena case FORMAT_RF64: case FORMAT_AIFF: case FORMAT_AIFF_C: + FLAC__ASSERT(sizeof(FLAC__off_t) == 8); + if(skip >= INT64_MAX / encoder_session.info.bytes_per_wide_sample) { + flac__utils_printf(stderr, 1, "%s: ERROR: value of --skip is too large\n", encoder_session.inbasefilename, encoder_session.info.bits_per_sample-encoder_session.info.shift); + return EncoderSession_finish_error(&encoder_session); + } encoder_session.fmt.iff.data_bytes -= skip * encoder_session.info.bytes_per_wide_sample; if(options.ignore_chunk_sizes) { encoder_session.total_samples_to_encode = 0; -- cgit v1.2.3 From fd842b6a3bacac9e47504ca4d4fb611fab014fa2 Mon Sep 17 00:00:00 2001 From: DK Date: Tue, 9 May 2023 15:37:57 +0300 Subject: Fixed compilation of get_utf8_argv() for Windows UWP Fixed compilation in Win32 environment. Use FLAC_WINDOWS_APP define to check between UWP app and Win32 for more consistency. --- src/share/win_utf8_io/win_utf8_io.c | 41 +++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/src/share/win_utf8_io/win_utf8_io.c b/src/share/win_utf8_io/win_utf8_io.c index 65b56997..18921748 100644 --- a/src/share/win_utf8_io/win_utf8_io.c +++ b/src/share/win_utf8_io/win_utf8_io.c @@ -39,9 +39,12 @@ #define UTF8_BUFFER_SIZE 32768 -#if !defined(WINAPI_FAMILY_PARTITION) -#define WINAPI_FAMILY_PARTITION(x) x -#define WINAPI_PARTITION_DESKTOP 1 +/* detect whether it is Windows APP (UWP) or standard Win32 envionment */ +#if defined(WINAPI_FAMILY_PARTITION) &&\ + WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) + #define FLAC_WINDOWS_APP 1 +#else + #define FLAC_WINDOWS_APP 0 #endif static int local_vsnprintf(char *str, size_t size, const char *fmt, va_list va) @@ -106,15 +109,22 @@ static wchar_t *wchar_from_utf8(const char *str) /* retrieve WCHAR commandline, expand wildcards and convert everything to UTF-8 */ int get_utf8_argv(int *argc, char ***argv) { +#if !FLAC_WINDOWS_APP typedef int (__cdecl *wgetmainargs_t)(int*, wchar_t***, wchar_t***, int, int*); wgetmainargs_t wgetmainargs; HMODULE handle; +#endif // !FLAC_WINDOWS_APP int wargc; wchar_t **wargv; wchar_t **wenv; char **utf8argv; int ret, i; +#if FLAC_WINDOWS_APP + wargc = __argc; + wargv = __wargv; + wenv = _wenviron; +#else // !FLAC_WINDOWS_APP if ((handle = LoadLibraryW(L"msvcrt.dll")) == NULL) return 1; if ((wgetmainargs = (wgetmainargs_t)GetProcAddress(handle, "__wgetmainargs")) == NULL) { FreeLibrary(handle); @@ -126,8 +136,11 @@ int get_utf8_argv(int *argc, char ***argv) FreeLibrary(handle); return 1; } +#endif // !FLAC_WINDOWS_APP if ((utf8argv = (char **)calloc(wargc, sizeof(char*))) == NULL) { + #if !FLAC_WINDOWS_APP FreeLibrary(handle); + #endif // !FLAC_WINDOWS_APP return 1; } @@ -139,7 +152,9 @@ int get_utf8_argv(int *argc, char ***argv) } } +#if !FLAC_WINDOWS_APP FreeLibrary(handle); /* do not free it when wargv or wenv are still in use */ +#endif // !FLAC_WINDOWS_APP if (ret == 0) { *argc = wargc; @@ -160,9 +175,9 @@ HANDLE WINAPI CreateFile_utf8(const char *lpFileName, DWORD dwDesiredAccess, DWO HANDLE handle = INVALID_HANDLE_VALUE; if ((wname = wchar_from_utf8(lpFileName)) != NULL) { -#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) +#if !FLAC_WINDOWS_APP handle = CreateFileW(wname, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile); -#else // !WINAPI_PARTITION_DESKTOP +#else // FLAC_WINDOWS_APP CREATEFILE2_EXTENDED_PARAMETERS params; params.dwSize = sizeof(params); params.dwFileAttributes = dwFlagsAndAttributes & 0xFFFF; @@ -171,7 +186,7 @@ HANDLE WINAPI CreateFile_utf8(const char *lpFileName, DWORD dwDesiredAccess, DWO params.lpSecurityAttributes = lpSecurityAttributes; params.hTemplateFile = hTemplateFile; handle = CreateFile2(wname, dwDesiredAccess, dwShareMode, dwCreationDisposition, ¶ms); -#endif // !WINAPI_PARTITION_DESKTOP +#endif // FLAC_WINDOWS_APP free(wname); } @@ -193,19 +208,19 @@ size_t strlen_utf8(const char *str) int win_get_console_width(void) { int width = 80; -#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) +#if !FLAC_WINDOWS_APP CONSOLE_SCREEN_BUFFER_INFO csbi; HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE); if(hOut != INVALID_HANDLE_VALUE && hOut != NULL) if (GetConsoleScreenBufferInfo(hOut, &csbi) != 0) width = csbi.dwSize.X; -#endif // WINAPI_PARTITION_DESKTOP +#endif // !FLAC_WINDOWS_APP return width; } /* print functions */ -#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) +#if !FLAC_WINDOWS_APP static int wprint_console(FILE *stream, const wchar_t *text, size_t len) { DWORD out; @@ -235,7 +250,7 @@ static int wprint_console(FILE *stream, const wchar_t *text, size_t len) return ret; return len; } -#endif // WINAPI_PARTITION_DESKTOP +#endif // !FLAC_WINDOWS_APP int printf_utf8(const char *format, ...) { @@ -276,12 +291,12 @@ int vfprintf_utf8(FILE *stream, const char *format, va_list argptr) ret = -1; break; } -#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) +#if !FLAC_WINDOWS_APP ret = wprint_console(stream, wout, wcslen(wout)); -#else // !WINAPI_PARTITION_DESKTOP +#else // FLAC_WINDOWS_APP OutputDebugStringW(wout); ret = 0; -#endif // !WINAPI_PARTITION_DESKTOP +#endif // FLAC_WINDOWS_APP } while(0); free(utmp); -- cgit v1.2.3 From c623f0f42c5fc8abb42ffddd2094cf095f4f7f57 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Fri, 14 Apr 2023 11:39:14 +0200 Subject: Fix use-after-free warning in GCC 12 A pointer was used for arithmatic after a realloc. Co-authored-by: Alexia Massalin --- src/share/utf8/iconvert.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/share/utf8/iconvert.c b/src/share/utf8/iconvert.c index 307e0024..9a1e3f6b 100644 --- a/src/share/utf8/iconvert.c +++ b/src/share/utf8/iconvert.c @@ -62,7 +62,7 @@ int iconvert(const char *fromcode, const char *tocode, char *ib; char *ob; char *utfbuf = 0, *outbuf, *newbuf; - size_t utflen, outlen, ibl, obl, k; + size_t utflen, outlen, ibl, obl, obp, k; char tbuf[2048]; cd1 = iconv_open("UTF-8", fromcode); @@ -124,11 +124,12 @@ int iconvert(const char *fromcode, const char *tocode, if(utflen*2 < utflen) /* overflow check */ goto fail; utflen *= 2; + obp = ob - utfbuf; /* save position */ newbuf = realloc(utfbuf, utflen); if (!newbuf) goto fail; - ob = (ob - utfbuf) + newbuf; - obl = utflen - (ob - newbuf); + ob = newbuf + obp; + obl = utflen - obp; utfbuf = newbuf; } else { -- cgit v1.2.3 From c65ef58924938e2375c427d0cfca6931d278f95c Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Wed, 26 Apr 2023 11:08:28 +0200 Subject: Stop processing subframes when invalid data is found This fixes https://github.com/xiph/flac/issues/580 The problem was that after encountering a problem in a first subframe, the state was changed from READ_FRAME to SEARCH_FOR_FRAME_SYNC, which meant a problem in the second subframe was interpreted as a read error instead of invalid data. With this patch, processing of subframes is stopped after setting SEARCH_FOR_FRAME_SYNC --- src/libFLAC/stream_decoder.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libFLAC/stream_decoder.c b/src/libFLAC/stream_decoder.c index 400aef14..6c82cbd7 100644 --- a/src/libFLAC/stream_decoder.c +++ b/src/libFLAC/stream_decoder.c @@ -2095,6 +2095,8 @@ FLAC__bool read_frame_(FLAC__StreamDecoder *decoder, FLAC__bool *got_a_frame, FL else return false; } + if(decoder->protected_->state != FLAC__STREAM_DECODER_READ_FRAME) + break; } if(decoder->protected_->state != FLAC__STREAM_DECODER_END_OF_STREAM) -- cgit v1.2.3 From 7ed6f4ff583261cf473d5ab01b5d3eab4789e1c7 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Thu, 11 May 2023 09:02:04 +0200 Subject: Throw error on too large foreign metadata directly Previously, too large chunks of foreign metadata (> 16MiB) were signalled by libFLAC, throwing an error upon adding the metadata, so flac gave a rather vague error back to the user. This commit adds detection to the foreign metadata handling, so the user gets a much clearer error. Credit: Oss-Fuzz Issue: N/A --- src/flac/foreign_metadata.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/flac/foreign_metadata.c b/src/flac/foreign_metadata.c index 63f982cc..1a638bc9 100644 --- a/src/flac/foreign_metadata.c +++ b/src/flac/foreign_metadata.c @@ -99,7 +99,12 @@ static FLAC__bool compare_data_(FILE *fin, FILE *fout, size_t size, const char * static FLAC__bool append_block_(foreign_metadata_t *fm, FLAC__off_t offset, FLAC__uint32 size, const char **error) { - foreign_block_t *fb = safe_realloc_nofree_muladd2_(fm->blocks, sizeof(foreign_block_t), /*times (*/fm->num_blocks, /*+*/1/*)*/); + foreign_block_t *fb; + if(size >= (1u << FLAC__STREAM_METADATA_LENGTH_LEN)) { + if(error) *error = "found foreign metadata chunk is too large (max is 16MiB per chunk)"; + return false; + } + fb = safe_realloc_nofree_muladd2_(fm->blocks, sizeof(foreign_block_t), /*times (*/fm->num_blocks, /*+*/1/*)*/); if(fb) { fb[fm->num_blocks].offset = offset; fb[fm->num_blocks].size = size; -- cgit v1.2.3 From f18692df181378d217823abae12999b431dc187c Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Tue, 16 May 2023 20:04:05 +0200 Subject: Add OOM check to metaflac append handling Credit: Oss-Fuzz Issue: N/A --- src/metaflac/operations.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/metaflac/operations.c b/src/metaflac/operations.c index 7ae3c635..e113ebc0 100644 --- a/src/metaflac/operations.c +++ b/src/metaflac/operations.c @@ -265,6 +265,8 @@ FLAC__bool do_major_operation__append(FLAC__Metadata_Chain *chain, const Command buffer_size = ((FLAC__uint32)(header[1]) << 16) + ((FLAC__uint32)(header[2]) << 8) + header[3]; buffer = safe_malloc_(buffer_size + FLAC__STREAM_METADATA_HEADER_LENGTH); + if(0 == buffer) + die("out of memory allocating read buffer"); memcpy(buffer, header, FLAC__STREAM_METADATA_HEADER_LENGTH); num_objects++; -- cgit v1.2.3 From ef34ee52694811700de0da9875f828b473a2111f Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Tue, 16 May 2023 20:53:11 +0200 Subject: Small correction on commit 7ed6f4f The 4 byte application id was not considered Credit: Oss-Fuzz Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=59015 --- src/flac/foreign_metadata.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/flac/foreign_metadata.c b/src/flac/foreign_metadata.c index 1a638bc9..1cef901b 100644 --- a/src/flac/foreign_metadata.c +++ b/src/flac/foreign_metadata.c @@ -100,7 +100,7 @@ static FLAC__bool compare_data_(FILE *fin, FILE *fout, size_t size, const char * static FLAC__bool append_block_(foreign_metadata_t *fm, FLAC__off_t offset, FLAC__uint32 size, const char **error) { foreign_block_t *fb; - if(size >= (1u << FLAC__STREAM_METADATA_LENGTH_LEN)) { + if(size >= ((1u << FLAC__STREAM_METADATA_LENGTH_LEN) - FLAC__STREAM_METADATA_APPLICATION_ID_LEN/8)) { if(error) *error = "found foreign metadata chunk is too large (max is 16MiB per chunk)"; return false; } -- cgit v1.2.3 From 890912644aac343a9ddba7fab0f9ae922ca79e6b Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Thu, 18 May 2023 20:05:54 +0200 Subject: Add seed corpus files for fuzzer_tool_flac --- .../aiff-with-foreign-metadata-8bps.fuzz | Bin 0 -> 475 bytes .../flac-foreign-metadata-aiff-8bps.fuzz | Bin 0 -> 684 bytes .../flac-foreign-metadata-wav-8bps.fuzz | Bin 0 -> 715 bytes .../replaygain-which-is-not-lossless-ogg.fuzz | Bin 0 -> 15406 bytes .../replaygain-which-is-not-lossless.fuzz | Bin 0 -> 15852 bytes .../wav-with-foreign-metadata-8bps.fuzz | Bin 0 -> 559 bytes 6 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 oss-fuzz/seedcorpus/fuzzer_tool_flac/aiff-with-foreign-metadata-8bps.fuzz create mode 100644 oss-fuzz/seedcorpus/fuzzer_tool_flac/flac-foreign-metadata-aiff-8bps.fuzz create mode 100644 oss-fuzz/seedcorpus/fuzzer_tool_flac/flac-foreign-metadata-wav-8bps.fuzz create mode 100644 oss-fuzz/seedcorpus/fuzzer_tool_flac/replaygain-which-is-not-lossless-ogg.fuzz create mode 100644 oss-fuzz/seedcorpus/fuzzer_tool_flac/replaygain-which-is-not-lossless.fuzz create mode 100644 oss-fuzz/seedcorpus/fuzzer_tool_flac/wav-with-foreign-metadata-8bps.fuzz diff --git a/oss-fuzz/seedcorpus/fuzzer_tool_flac/aiff-with-foreign-metadata-8bps.fuzz b/oss-fuzz/seedcorpus/fuzzer_tool_flac/aiff-with-foreign-metadata-8bps.fuzz new file mode 100644 index 00000000..944c775a Binary files /dev/null and b/oss-fuzz/seedcorpus/fuzzer_tool_flac/aiff-with-foreign-metadata-8bps.fuzz differ diff --git a/oss-fuzz/seedcorpus/fuzzer_tool_flac/flac-foreign-metadata-aiff-8bps.fuzz b/oss-fuzz/seedcorpus/fuzzer_tool_flac/flac-foreign-metadata-aiff-8bps.fuzz new file mode 100644 index 00000000..36fe91b5 Binary files /dev/null and b/oss-fuzz/seedcorpus/fuzzer_tool_flac/flac-foreign-metadata-aiff-8bps.fuzz differ diff --git a/oss-fuzz/seedcorpus/fuzzer_tool_flac/flac-foreign-metadata-wav-8bps.fuzz b/oss-fuzz/seedcorpus/fuzzer_tool_flac/flac-foreign-metadata-wav-8bps.fuzz new file mode 100644 index 00000000..6f4ed9c5 Binary files /dev/null and b/oss-fuzz/seedcorpus/fuzzer_tool_flac/flac-foreign-metadata-wav-8bps.fuzz differ diff --git a/oss-fuzz/seedcorpus/fuzzer_tool_flac/replaygain-which-is-not-lossless-ogg.fuzz b/oss-fuzz/seedcorpus/fuzzer_tool_flac/replaygain-which-is-not-lossless-ogg.fuzz new file mode 100644 index 00000000..e211fc6e Binary files /dev/null and b/oss-fuzz/seedcorpus/fuzzer_tool_flac/replaygain-which-is-not-lossless-ogg.fuzz differ diff --git a/oss-fuzz/seedcorpus/fuzzer_tool_flac/replaygain-which-is-not-lossless.fuzz b/oss-fuzz/seedcorpus/fuzzer_tool_flac/replaygain-which-is-not-lossless.fuzz new file mode 100644 index 00000000..9d97430b Binary files /dev/null and b/oss-fuzz/seedcorpus/fuzzer_tool_flac/replaygain-which-is-not-lossless.fuzz differ diff --git a/oss-fuzz/seedcorpus/fuzzer_tool_flac/wav-with-foreign-metadata-8bps.fuzz b/oss-fuzz/seedcorpus/fuzzer_tool_flac/wav-with-foreign-metadata-8bps.fuzz new file mode 100644 index 00000000..d708a3cb Binary files /dev/null and b/oss-fuzz/seedcorpus/fuzzer_tool_flac/wav-with-foreign-metadata-8bps.fuzz differ -- cgit v1.2.3 From 69155423c41dd71c935afd3e84f043952cc2f5de Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Fri, 19 May 2023 08:05:22 +0200 Subject: Check for replaygain peak value being positive on parsing --- src/share/grabbag/replaygain.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/share/grabbag/replaygain.c b/src/share/grabbag/replaygain.c index 7d81e0fe..6c58def1 100644 --- a/src/share/grabbag/replaygain.c +++ b/src/share/grabbag/replaygain.c @@ -641,6 +641,8 @@ FLAC__bool grabbag__replaygain_load_from_vorbiscomment(const FLAC__StreamMetadat res = false; if(res && !parse_double_(block->data.vorbis_comment.comments + peak_offset, peak)) res = false; + if(res && *peak < 0.0) + res = false; setlocale(LC_ALL, saved_locale); free(saved_locale); -- cgit v1.2.3 From 808efb328717af811d24a8d59fdcc73f5f328b01 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Fri, 19 May 2023 08:12:55 +0200 Subject: Explicitly check for bps == 0 when applying replaygain During application of replaygain, bps is checked to be > 0. This should never happen in a valid file. This check is specific for replaygain application instead of more generic (at streaminfo) because we still want to be able to recover files in which streaminfo is invalid or missing. --- src/flac/decode.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/flac/decode.c b/src/flac/decode.c index d874b4b8..bb39fcd2 100644 --- a/src/flac/decode.c +++ b/src/flac/decode.c @@ -1543,6 +1543,13 @@ void metadata_callback(const FLAC__StreamDecoder *decoder, const FLAC__StreamMet return; } } + else if(decoder_session->bps == 0) { + flac__utils_printf(stderr, 1, "%s: WARNING: can't apply ReplayGain, bit-per-sample value is invalid\n", decoder_session->inbasefilename); + if(decoder_session->treat_warnings_as_errors) { + decoder_session->abort_flag = true; + return; + } + } else { const char *ls[] = { "no", "peak", "hard" }; const char *ns[] = { "no", "low", "medium", "high" }; -- cgit v1.2.3 From 7761f5472cd68372227b3adabc49b2e0cad843ab Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Fri, 19 May 2023 12:13:58 +0200 Subject: Check for FLAC__STREAM_DECODER_ABORTED on reencoding This status was ignored, leading to an infinite loop --- src/flac/encode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/flac/encode.c b/src/flac/encode.c index b8f5207a..399956d9 100644 --- a/src/flac/encode.c +++ b/src/flac/encode.c @@ -1403,7 +1403,7 @@ int flac__encode_file(FILE *infile, FLAC__off_t infilesize, const char *infilena break; } - if(!FLAC__stream_decoder_process_single(encoder_session.fmt.flac.decoder)) { + if(decoder_state == FLAC__STREAM_DECODER_ABORTED || !FLAC__stream_decoder_process_single(encoder_session.fmt.flac.decoder)) { flac__utils_printf(stderr, 1, "%s: ERROR: while decoding FLAC input, state = %s\n", encoder_session.inbasefilename, FLAC__stream_decoder_get_resolved_state_string(encoder_session.fmt.flac.decoder)); return EncoderSession_finish_error(&encoder_session); } -- cgit v1.2.3 From 9e157b5e1e426fafc9ab0791d6d5344731b1cc30 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Mon, 22 May 2023 12:02:41 +0200 Subject: Explain that --with-filename does not work with --export options --- man/metaflac.md | 3 ++- src/metaflac/usage.c | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/man/metaflac.md b/man/metaflac.md index 5a7f8850..cc50e462 100644 --- a/man/metaflac.md +++ b/man/metaflac.md @@ -58,7 +58,8 @@ modification time is set to the current time): **\--with-filename** : Prefix each output line with the FLAC file name (the default if more - than one FLAC file is specified). + than one FLAC file is specified). This option has no effect for + options exporting to a file, like --export-tags-to. **\--no-filename** : Do not prefix each output line with the FLAC file name (the default diff --git a/src/metaflac/usage.c b/src/metaflac/usage.c index 4690134b..eeea946e 100644 --- a/src/metaflac/usage.c +++ b/src/metaflac/usage.c @@ -62,7 +62,9 @@ static void usage_summary(FILE *out) fprintf(out, "Options:\n"); fprintf(out, "--preserve-modtime Preserve the original modification time in spite of edits\n"); fprintf(out, "--with-filename Prefix each output line with the FLAC file name\n"); - fprintf(out, " (the default if more than one FLAC file is specified)\n"); + fprintf(out, " (the default if more than one FLAC file is specified).\n"); + fprintf(out, " This option has no effect for options exporting to a\n"); + fprintf(out, " file, like --export-tags-to.\n"); fprintf(out, "--no-filename Do not prefix each output line with the FLAC file name\n"); fprintf(out, " (the default if only one FLAC file is specified)\n"); fprintf(out, "--no-utf8-convert Do not convert tags from UTF-8 to local charset,\n"); -- cgit v1.2.3 From c8e6f7372cd0acd0bfc49609ebd711e0d754dd2f Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Mon, 22 May 2023 21:21:33 +0200 Subject: Prevent overflow when parsing RIFF fmt chunk --- src/flac/encode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/flac/encode.c b/src/flac/encode.c index 399956d9..fc05689a 100644 --- a/src/flac/encode.c +++ b/src/flac/encode.c @@ -327,7 +327,7 @@ static FLAC__bool get_sample_info_wave(EncoderSession *e, encode_options_t optio } data_bytes -= (16+8); } - if(data_bytes < 16) { + if(data_bytes < 16 || data_bytes > (UINT32_MAX-8)) { flac__utils_printf(stderr, 1, "%s: ERROR: non-standard 'fmt ' chunk has length = %u\n", e->inbasefilename, (uint32_t)data_bytes); return false; } -- cgit v1.2.3 From 6571cbbf170a64885227d60a3d80540c7a4455fb Mon Sep 17 00:00:00 2001 From: dmitrykos Date: Mon, 22 May 2023 20:50:43 +0300 Subject: Fixed compile error under Windows if winapifamily.h is unavailable (regression of fd842b6a3bacac9e47504ca4d4fb611fab014fa2). --- src/share/win_utf8_io/win_utf8_io.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/share/win_utf8_io/win_utf8_io.c b/src/share/win_utf8_io/win_utf8_io.c index 18921748..4896a362 100644 --- a/src/share/win_utf8_io/win_utf8_io.c +++ b/src/share/win_utf8_io/win_utf8_io.c @@ -40,9 +40,12 @@ #define UTF8_BUFFER_SIZE 32768 /* detect whether it is Windows APP (UWP) or standard Win32 envionment */ -#if defined(WINAPI_FAMILY_PARTITION) &&\ - WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) - #define FLAC_WINDOWS_APP 1 +#ifdef WINAPI_FAMILY_PARTITION + #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) + #define FLAC_WINDOWS_APP 1 + #else + #define FLAC_WINDOWS_APP 0 + #endif #else #define FLAC_WINDOWS_APP 0 #endif -- cgit v1.2.3 From 0b8a271b3eb0e823257a17d2b5aa512909d0be1b Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Wed, 24 May 2023 14:52:13 +0200 Subject: Fix version number display on Windows This adds windows-specific version information to build objects Co-authored-by: Ozkan Sezer --- configure.ac | 2 ++ doc/release_checklist.md | 3 ++- src/flac/CMakeLists.txt | 1 + src/flac/Makefile.am | 20 +++++++++++++++----- src/flac/version.rc | 38 ++++++++++++++++++++++++++++++++++++++ src/libFLAC++/CMakeLists.txt | 3 ++- src/libFLAC++/Makefile.am | 15 +++++++++++++-- src/libFLAC++/version.rc | 40 ++++++++++++++++++++++++++++++++++++++++ src/libFLAC/CMakeLists.txt | 1 + src/libFLAC/Makefile.am | 10 +++++++++- src/libFLAC/version.rc | 40 ++++++++++++++++++++++++++++++++++++++++ src/metaflac/CMakeLists.txt | 1 + src/metaflac/Makefile.am | 20 ++++++++++++++------ src/metaflac/version.rc | 38 ++++++++++++++++++++++++++++++++++++++ 14 files changed, 216 insertions(+), 16 deletions(-) create mode 100644 src/flac/version.rc create mode 100644 src/libFLAC++/version.rc create mode 100644 src/libFLAC/version.rc create mode 100644 src/metaflac/version.rc diff --git a/configure.ac b/configure.ac index 5358fa8f..f9e60db3 100644 --- a/configure.ac +++ b/configure.ac @@ -176,10 +176,12 @@ os_is_windows=no case "$host" in *mingw*) os_is_windows=yes + AC_CHECK_TOOL(RC,[windres],[:]) ;; esac AM_CONDITIONAL(OS_IS_WINDOWS, test "x$os_is_windows" = xyes) +AM_CONDITIONAL(HAVE_WINDRES, test "x$RC" != "x:") case "$host" in *-linux-*) diff --git a/doc/release_checklist.md b/doc/release_checklist.md index 914d792c..ca826def 100644 --- a/doc/release_checklist.md +++ b/doc/release_checklist.md @@ -11,7 +11,8 @@ 1. Update changelog 1. Check copyright year and update if applicable 1. Check libFLAC and libFLAC++ for interface changes and update - version numbers in include/FLAC/export.h and include/FLAC++/export.h + version numbers in include/FLAC/export.h, include/FLAC++/export.h + src/libFLAC/CMakeLists.txt and src/libFLAC++/CMakeLists.txt 1. Prepare and check release tarball by running `git clean -ffxd && ./autogen.sh && ./configure && make distcheck` 1. Check whether release tarball contains api documentation and diff --git a/src/flac/CMakeLists.txt b/src/flac/CMakeLists.txt index 40034502..da7ce8de 100644 --- a/src/flac/CMakeLists.txt +++ b/src/flac/CMakeLists.txt @@ -10,6 +10,7 @@ add_executable(flacapp local_string_utils.c utils.c vorbiscomment.c + version.rc $<$:../../include/share/win_utf8_io.h> $<$:../share/win_utf8_io/win_utf8_io.c>) set_property(TARGET flacapp PROPERTY RUNTIME_OUTPUT_NAME flac) diff --git a/src/flac/Makefile.am b/src/flac/Makefile.am index 5fc34386..eb1fa847 100644 --- a/src/flac/Makefile.am +++ b/src/flac/Makefile.am @@ -16,13 +16,22 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +if OS_IS_WINDOWS +win_utf8_lib = $(top_builddir)/src/share/win_utf8_io/libwin_utf8_io.la +if HAVE_WINDRES +flac_DEPENDENCIES = version.o +windows_resource_link = -Wl,version.o +endif +endif + bin_PROGRAMS = flac AM_CFLAGS = @OGG_CFLAGS@ AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include EXTRA_DIST = \ CMakeLists.txt \ - iffscan.c + iffscan.c \ + version.rc flac_SOURCES = \ analyze.c \ @@ -41,10 +50,6 @@ flac_SOURCES = \ utils.h \ vorbiscomment.h -if OS_IS_WINDOWS -win_utf8_lib = $(top_builddir)/src/share/win_utf8_io/libwin_utf8_io.la -endif - flac_LDADD = \ $(top_builddir)/src/share/utf8/libutf8.la \ $(top_builddir)/src/share/grabbag/libgrabbag.la \ @@ -56,4 +61,9 @@ flac_LDADD = \ @LTLIBICONV@ \ -lm +flac_LDFLAGS = $(AM_LDFLAGS) $(windows_resource_link) + CLEANFILES = flac.exe + +.rc.o: + $(RC) $(AM_CPPFLAGS) $< $@ diff --git a/src/flac/version.rc b/src/flac/version.rc new file mode 100644 index 00000000..00842b92 --- /dev/null +++ b/src/flac/version.rc @@ -0,0 +1,38 @@ +#include +#include "config.h" + +#if (defined GIT_COMMIT_HASH && defined GIT_COMMIT_DATE) +# ifdef GIT_COMMIT_TAG +# define VERSIONSTRING GIT_COMMIT_TAG +# else +# define VERSIONSTRING "git-" GIT_COMMIT_HASH +# endif +#else +# define VERSIONSTRING PACKAGE_VERSION +#endif + +#define xstr(s) str(s) +#define str(s) #s + +VS_VERSION_INFO VERSIONINFO +FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +FILEFLAGS 0 +FILEOS VOS__WINDOWS32 +FILETYPE VFT_DLL +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "FileDescription", "flac command line tool for Windows" + VALUE "ProductName", "Free Lossless Audio Codec" + VALUE "ProductVersion", VERSIONSTRING + VALUE "CompanyName", "Xiph.Org" + VALUE "LegalCopyright", "2000-2009 Josh Coalson, 2011-2023 Xiph.Org Foundation" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END diff --git a/src/libFLAC++/CMakeLists.txt b/src/libFLAC++/CMakeLists.txt index 81d466a4..1a2a03ed 100644 --- a/src/libFLAC++/CMakeLists.txt +++ b/src/libFLAC++/CMakeLists.txt @@ -1,7 +1,8 @@ add_library(FLAC++ metadata.cpp stream_decoder.cpp - stream_encoder.cpp) + stream_encoder.cpp + version.rc) set_property(TARGET FLAC++ PROPERTY PROJECT_LABEL "libFLAC++") target_compile_definitions(FLAC++ PRIVATE $<$:FLACPP_API_EXPORTS> diff --git a/src/libFLAC++/Makefile.am b/src/libFLAC++/Makefile.am index 77d2e6fd..df4daa7e 100644 --- a/src/libFLAC++/Makefile.am +++ b/src/libFLAC++/Makefile.am @@ -41,17 +41,28 @@ AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include EXTRA_DIST = \ CMakeLists.txt \ flac++.pc.in \ - libFLAC++.m4 + libFLAC++.m4 \ + version.rc libFLAC___sources = \ metadata.cpp \ stream_decoder.cpp \ stream_encoder.cpp +if OS_IS_WINDOWS +if HAVE_WINDRES +libFLAC___la_DEPENDENCIES = version.o +windows_resource_link = -Wl,version.o +endif +endif + # see 'http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning' for numbering convention -libFLAC___la_LDFLAGS = $(AM_LDFLAGS) -no-undefined -version-info 10:0:0 +libFLAC___la_LDFLAGS = $(AM_LDFLAGS) -no-undefined -version-info 10:0:0 $(windows_resource_link) libFLAC___la_LIBADD = ../libFLAC/libFLAC.la libFLAC___la_SOURCES = $(libFLAC___sources) libFLAC___static_la_SOURCES = $(libFLAC___sources) libFLAC___static_la_LIBADD = ../libFLAC/libFLAC-static.la + +.rc.o: + $(RC) $(AM_CPPFLAGS) $< $@ diff --git a/src/libFLAC++/version.rc b/src/libFLAC++/version.rc new file mode 100644 index 00000000..559fcedf --- /dev/null +++ b/src/libFLAC++/version.rc @@ -0,0 +1,40 @@ +#include +#include "config.h" +#include "FLAC++/export.h" + +#if (defined GIT_COMMIT_HASH && defined GIT_COMMIT_DATE) +# ifdef GIT_COMMIT_TAG +# define VERSIONSTRING GIT_COMMIT_TAG +# else +# define VERSIONSTRING "git-" GIT_COMMIT_HASH +# endif +#else +# define VERSIONSTRING PACKAGE_VERSION +#endif + +#define xstr(s) str(s) +#define str(s) #s + +VS_VERSION_INFO VERSIONINFO +FILEVERSION FLACPP_API_VERSION_CURRENT,0,0,0 +FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +FILEFLAGS 0 +FILEOS VOS__WINDOWS32 +FILETYPE VFT_DLL +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "FileDescription", "libFLAC++ for Windows" + VALUE "ProductName", "Free Lossless Audio Codec" + VALUE "ProductVersion", VERSIONSTRING + VALUE "CompanyName", "Xiph.Org" + VALUE "LegalCopyright", "2000-2009 Josh Coalson, 2011-2023 Xiph.Org Foundation" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END diff --git a/src/libFLAC/CMakeLists.txt b/src/libFLAC/CMakeLists.txt index e6c20735..9a43dd33 100644 --- a/src/libFLAC/CMakeLists.txt +++ b/src/libFLAC/CMakeLists.txt @@ -63,6 +63,7 @@ add_library(FLAC stream_encoder_intrin_ssse3.c stream_encoder_intrin_avx2.c stream_encoder_framing.c + version.rc window.c $<$:../../include/share/win_utf8_io.h> $<$:../share/win_utf8_io/win_utf8_io.c> diff --git a/src/libFLAC/Makefile.am b/src/libFLAC/Makefile.am index dd2a5e39..89648dc7 100644 --- a/src/libFLAC/Makefile.am +++ b/src/libFLAC/Makefile.am @@ -56,6 +56,7 @@ EXTRA_DIST = \ CMakeLists.txt \ flac.pc.in \ libFLAC.m4 \ + version.rc \ deduplication/bitreader_read_rice_signed_block.c \ deduplication/lpc_compute_autocorrelation_intrin.c \ deduplication/lpc_compute_autocorrelation_intrin_sse2.c \ @@ -63,6 +64,10 @@ EXTRA_DIST = \ if OS_IS_WINDOWS windows_unicode_compat = ../share/win_utf8_io/win_utf8_io.c +if HAVE_WINDRES +libFLAC_la_DEPENDENCIES = version.o +windows_resource_link = -Wl,version.o +endif endif if FLaC__HAS_OGG @@ -74,7 +79,7 @@ extra_ogg_sources = \ endif # see 'http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning' for numbering convention -libFLAC_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined -version-info 12:0:0 +libFLAC_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined -version-info 12:0:0 $(windows_resource_link) libFLAC_sources = \ bitmath.c \ @@ -113,3 +118,6 @@ libFLAC_la_SOURCES = $(libFLAC_sources) # needed for test_libFLAC libFLAC_static_la_SOURCES = $(libFLAC_sources) + +.rc.o: + $(RC) $(AM_CPPFLAGS) $< $@ diff --git a/src/libFLAC/version.rc b/src/libFLAC/version.rc new file mode 100644 index 00000000..585c3911 --- /dev/null +++ b/src/libFLAC/version.rc @@ -0,0 +1,40 @@ +#include +#include "config.h" +#include "FLAC/export.h" + +#if (defined GIT_COMMIT_HASH && defined GIT_COMMIT_DATE) +# ifdef GIT_COMMIT_TAG +# define VERSIONSTRING GIT_COMMIT_TAG +# else +# define VERSIONSTRING "git-" GIT_COMMIT_HASH +# endif +#else +# define VERSIONSTRING PACKAGE_VERSION +#endif + +#define xstr(s) str(s) +#define str(s) #s + +VS_VERSION_INFO VERSIONINFO +FILEVERSION FLAC_API_VERSION_CURRENT,0,0,0 +FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +FILEFLAGS 0 +FILEOS VOS__WINDOWS32 +FILETYPE VFT_DLL +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "FileDescription", "libFLAC for Windows" + VALUE "ProductName", "Free Lossless Audio Codec" + VALUE "ProductVersion", VERSIONSTRING + VALUE "CompanyName", "Xiph.Org" + VALUE "LegalCopyright", "2000-2009 Josh Coalson, 2011-2023 Xiph.Org Foundation" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END diff --git a/src/metaflac/CMakeLists.txt b/src/metaflac/CMakeLists.txt index 677ab1a5..b8af7058 100644 --- a/src/metaflac/CMakeLists.txt +++ b/src/metaflac/CMakeLists.txt @@ -9,6 +9,7 @@ add_executable(metaflac options.c usage.c utils.c + version.rc $<$:../../include/share/win_utf8_io.h> $<$:../share/win_utf8_io/win_utf8_io.c>) target_link_libraries(metaflac FLAC getopt utf8) diff --git a/src/metaflac/Makefile.am b/src/metaflac/Makefile.am index 446a3c37..e5bee918 100644 --- a/src/metaflac/Makefile.am +++ b/src/metaflac/Makefile.am @@ -16,12 +16,21 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +if OS_IS_WINDOWS +win_utf8_lib = $(top_builddir)/src/share/win_utf8_io/libwin_utf8_io.la +if HAVE_WINDRES +metaflac_DEPENDENCIES = version.o +windows_resource_link = -Wl,version.o +endif +endif + bin_PROGRAMS = metaflac AM_CFLAGS = @OGG_CFLAGS@ AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include EXTRA_DIST = \ - CMakeLists.txt + CMakeLists.txt \ + version.rc metaflac_SOURCES = \ main.c \ @@ -39,11 +48,7 @@ metaflac_SOURCES = \ options.h \ usage.h \ utils.h -metaflac_LDFLAGS = $(AM_LDFLAGS) - -if OS_IS_WINDOWS -win_utf8_lib = $(top_builddir)/src/share/win_utf8_io/libwin_utf8_io.la -endif +metaflac_LDFLAGS = $(AM_LDFLAGS) $(windows_resource_link) metaflac_LDADD = \ $(top_builddir)/src/share/grabbag/libgrabbag.la \ @@ -55,3 +60,6 @@ metaflac_LDADD = \ @LTLIBICONV@ CLEANFILES = metaflac.exe + +.rc.o: + $(RC) $(AM_CPPFLAGS) $< $@ diff --git a/src/metaflac/version.rc b/src/metaflac/version.rc new file mode 100644 index 00000000..51172024 --- /dev/null +++ b/src/metaflac/version.rc @@ -0,0 +1,38 @@ +#include +#include "config.h" + +#if (defined GIT_COMMIT_HASH && defined GIT_COMMIT_DATE) +# ifdef GIT_COMMIT_TAG +# define VERSIONSTRING GIT_COMMIT_TAG +# else +# define VERSIONSTRING "git-" GIT_COMMIT_HASH +# endif +#else +# define VERSIONSTRING PACKAGE_VERSION +#endif + +#define xstr(s) str(s) +#define str(s) #s + +VS_VERSION_INFO VERSIONINFO +FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +FILEFLAGS 0 +FILEOS VOS__WINDOWS32 +FILETYPE VFT_DLL +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "FileDescription", "metaflac command line tool for Windows" + VALUE "ProductName", "Free Lossless Audio Codec" + VALUE "ProductVersion", VERSIONSTRING + VALUE "CompanyName", "Xiph.Org" + VALUE "LegalCopyright", "2000-2009 Josh Coalson, 2011-2023 Xiph.Org Foundation" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END -- cgit v1.2.3 From 1619af5a36fc0343cdf6b3517bb78d8aee85fe59 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Tue, 30 May 2023 07:41:35 +0200 Subject: Update changelog and library version numbers --- .github/workflows/distcheck.yml | 8 +++++++- CHANGELOG.md | 39 +++++++++++++++++++++++++++++++++++++++ include/FLAC++/export.h | 2 +- include/FLAC/export.h | 4 ++-- src/libFLAC++/CMakeLists.txt | 2 +- src/libFLAC++/version.rc | 2 +- src/libFLAC/CMakeLists.txt | 2 +- src/libFLAC/version.rc | 2 +- 8 files changed, 53 insertions(+), 8 deletions(-) diff --git a/.github/workflows/distcheck.yml b/.github/workflows/distcheck.yml index ec47f248..9694dbe0 100644 --- a/.github/workflows/distcheck.yml +++ b/.github/workflows/distcheck.yml @@ -34,6 +34,13 @@ jobs: abi-compliance-checker -l flac -old test/abi/abi-libFLAC-1.4.0.dump -new test/abi/abi-descriptor-libFLAC-1.4.0.xml abi-compliance-checker -l flac++ -old test/abi/abi-libFLAC++-1.4.0.dump -new test/abi/abi-descriptor-libFLAC++-1.4.0.xml + - name: Upload ABI compliance reports + uses: actions/upload-artifact@v3 + with: + name: flac-${{ github.sha }}-${{ github.run_id }}-compat + path: | + ./compat_reports + - name: Upload logs on failure uses: actions/upload-artifact@v3 if: failure() @@ -41,4 +48,3 @@ jobs: name: flac-${{ github.sha }}-${{ github.run_id }}-logs path: | ./flac-**/**/*.log - ./compat_reports diff --git a/CHANGELOG.md b/CHANGELOG.md index cd0aa0b7..9c8f4ee7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,45 @@ This changelog is not exhaustive, review [the git commit log](https://github.com/xiph/flac/commits) for an exhaustive list of changes. +## git as of 2023-05-28 + +As there have been additions to the libFLAC interfaces, the libFLAC version number is incremented to 13. The libFLAC++ version number stays at 10. + +* General + * All PowerPC-specific code has been removed, as it turned out those improvements didn't actually improve anything + * Large improvements in encoder speed for all presets. The largest change is for the fastest presets and for 24-bit and 32-bit inputs. + * Small improvement in decoder speed for BMI2-capable CPUs +* flac + * A lot of small fixes for bugs found by fuzzing + * Various improvements to the --keep-foreign-metadata and --keep-foreign-metadata-if-present options on decoding + * The output format (WAV/AIFF/RF64 etc.) is now automatically selected based on what kind of foreign metadata is stored + * Decoded file is checked afterwards, to see whether stored foreign format data agrees with FLAC audio properties + * AIFF-C sowt data can now be restored + * Add --force-legacy-wave-format option, to decode to WAV with WAVEFORMATPCM where WAVE_FORMAT_EXTENSIBLE would be more appropriate + * Add --force-aiff-c-none-format and --force-aiff-c-sowt-format to decode to AIFF-C + * The storage of WAVEFORMATEXTENSIBLE_CHANNEL_MASK is no longer restricted to known channel orderings + * Throw an error when WAV or AIFF files are over 4GiB in length and the --ignore-chunk-sizes option is not set + * Warn on testing files when ID3v2 tags are found + * Warn when data trails the audio data of a WAV/AIFF/RF64/W64 file + * Fix output file not being deleted after error on Windows + * Fix compilation on UWP platform +* metaflac + * A lot of small fixes for bugs found by fuzzing + * Added options --append and --data-format, which makes it possible to copy metadata blocks from one FLAC file to another + * Added option --remove-all-tags-except + * Added option --show-all-tags +* libFLAC + * No longer write seektables to Ogg, even when specifically asked for. Seektables in Ogg are not defined + * Add functions FLAC__metadata_object_set_raw and FLAC__metadata_object_get_raw to convert between blob and FLAC__StreamMetadata +* Build system + * Autoconf (configure) + * The option --enable-64-bit-words is now on by default + * CMake + * The option ENABLE_64_BIT_WORDS is now on by default +* Testing/validation + * Fuzzers were added for the flac and metaflac command line tools + * Fuzzer coverage was improved + ## FLAC 1.4.2 (22-Oct-2022) Once again, this release only has a few changes. A problem with FLAC playback in GStreamer (and possibly other libFLAC users) was the reason for the short time since the last release diff --git a/include/FLAC++/export.h b/include/FLAC++/export.h index 19370fab..3745692b 100644 --- a/include/FLAC++/export.h +++ b/include/FLAC++/export.h @@ -92,7 +92,7 @@ * http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning */ #define FLACPP_API_VERSION_CURRENT 10 -#define FLACPP_API_VERSION_REVISION 0 /**< see above */ +#define FLACPP_API_VERSION_REVISION 1 /**< see above */ #define FLACPP_API_VERSION_AGE 0 /**< see above */ /* \} */ diff --git a/include/FLAC/export.h b/include/FLAC/export.h index 983f13b1..adbde7b0 100644 --- a/include/FLAC/export.h +++ b/include/FLAC/export.h @@ -95,9 +95,9 @@ /** These \#defines will mirror the libtool-based library version number, see * http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning */ -#define FLAC_API_VERSION_CURRENT 12 +#define FLAC_API_VERSION_CURRENT 13 #define FLAC_API_VERSION_REVISION 0 /**< see above */ -#define FLAC_API_VERSION_AGE 0 /**< see above */ +#define FLAC_API_VERSION_AGE 1 /**< see above */ #ifdef __cplusplus extern "C" { diff --git a/src/libFLAC++/CMakeLists.txt b/src/libFLAC++/CMakeLists.txt index 1a2a03ed..51fe4c44 100644 --- a/src/libFLAC++/CMakeLists.txt +++ b/src/libFLAC++/CMakeLists.txt @@ -16,7 +16,7 @@ target_include_directories(FLAC++ INTERFACE target_link_libraries(FLAC++ PUBLIC FLAC) if(BUILD_SHARED_LIBS) set_target_properties(FLAC++ PROPERTIES - VERSION 10.0.0 + VERSION 10.1.0 SOVERSION 10) if(NOT WIN32) set_target_properties(FLAC++ PROPERTIES CXX_VISIBILITY_PRESET hidden) diff --git a/src/libFLAC++/version.rc b/src/libFLAC++/version.rc index 559fcedf..14efba06 100644 --- a/src/libFLAC++/version.rc +++ b/src/libFLAC++/version.rc @@ -16,7 +16,7 @@ #define str(s) #s VS_VERSION_INFO VERSIONINFO -FILEVERSION FLACPP_API_VERSION_CURRENT,0,0,0 +FILEVERSION FLACPP_API_VERSION_CURRENT,FLACPP_API_VERSION_REVISION,0,0 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGS 0 FILEOS VOS__WINDOWS32 diff --git a/src/libFLAC/CMakeLists.txt b/src/libFLAC/CMakeLists.txt index 9a43dd33..5e746277 100644 --- a/src/libFLAC/CMakeLists.txt +++ b/src/libFLAC/CMakeLists.txt @@ -91,7 +91,7 @@ if(TARGET Ogg::ogg) endif() if(BUILD_SHARED_LIBS) set_target_properties(FLAC PROPERTIES - VERSION 12.0.0 + VERSION 13.0.0 SOVERSION 12) if(NOT WIN32) set_target_properties(FLAC PROPERTIES C_VISIBILITY_PRESET hidden) diff --git a/src/libFLAC/version.rc b/src/libFLAC/version.rc index 585c3911..019da1dd 100644 --- a/src/libFLAC/version.rc +++ b/src/libFLAC/version.rc @@ -16,7 +16,7 @@ #define str(s) #s VS_VERSION_INFO VERSIONINFO -FILEVERSION FLAC_API_VERSION_CURRENT,0,0,0 +FILEVERSION FLAC_API_VERSION_CURRENT,FLAC_API_VERSION_REVISION,0,0 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGS 0 FILEOS VOS__WINDOWS32 -- cgit v1.2.3 From d6974b9702a80bbea7eaee81c60cb491fe81e175 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Wed, 31 May 2023 21:49:44 +0200 Subject: Remove sector align option This option has been deprecated since FLAC 1.3.0. --- man/flac.md | 6 --- oss-fuzz/tool_flac.c | 1 - src/flac/encode.c | 123 +++------------------------------------------------ src/flac/encode.h | 4 -- src/flac/main.c | 55 ----------------------- test/test_flac.sh | 77 ++++---------------------------- 6 files changed, 14 insertions(+), 252 deletions(-) diff --git a/man/flac.md b/man/flac.md index a01c6c90..58bb8bf4 100644 --- a/man/flac.md +++ b/man/flac.md @@ -384,11 +384,6 @@ the HTML documentation. FILENAME is just shorthand for "\|\|\|\|FILENAME". For the format of SPECIFICATION, see the section **picture specification**. -**\--sector-align** -: Align encoding of multiple CD format files on sector boundaries. See the - HTML documentation for more information. This option is DEPRECATED and - may not exist in future versions of flac. - **\--ignore-chunk-sizes** : When encoding to flac, ignore the file size headers in WAV and AIFF files to attempt to work around problems with over-sized or malformed @@ -587,7 +582,6 @@ the HTML documentation. **\--no-replay-gain** **\--no-residual-gnuplot** **\--no-residual-text** -**\--no-sector-align** **\--no-seektable** **\--no-silent** **\--no-verify** diff --git a/oss-fuzz/tool_flac.c b/oss-fuzz/tool_flac.c index 23bab345..ce10a072 100644 --- a/oss-fuzz/tool_flac.c +++ b/oss-fuzz/tool_flac.c @@ -56,7 +56,6 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) flac__utils_verbosity_ = 0; share__opterr = 0; share__optind = 0; - align_reservoir_samples = 0; if(size < 2) return 0; diff --git a/src/flac/encode.c b/src/flac/encode.c index fc05689a..20bcc235 100644 --- a/src/flac/encode.c +++ b/src/flac/encode.c @@ -47,7 +47,6 @@ #endif #define max(x,y) ((x)>(y)?(x):(y)) -/* this MUST be >= 588 so that sector aligning can take place with one read */ /* this MUST be < 2^sizeof(size_t) / ( FLAC__MAX_CHANNELS * (FLAC__MAX_BITS_PER_SAMPLE/8) ) */ #define CHUNK_OF_SAMPLES 2048 @@ -143,7 +142,7 @@ static FLAC__int32 *input_[FLAC__MAX_CHANNELS]; */ static FLAC__bool EncoderSession_construct(EncoderSession *e, encode_options_t options, FLAC__off_t infilesize, FILE *infile, const char *infilename, const char *outfilename, const FLAC__byte *lookahead, uint32_t lookahead_length); static void EncoderSession_destroy(EncoderSession *e); -static int EncoderSession_finish_ok(EncoderSession *e, int info_align_carry, int info_align_zero, foreign_metadata_t *foreign_metadata, FLAC__bool error_on_compression_fail); +static int EncoderSession_finish_ok(EncoderSession *e, foreign_metadata_t *foreign_metadata, FLAC__bool error_on_compression_fail); static int EncoderSession_finish_error(EncoderSession *e); static FLAC__bool EncoderSession_init_encoder(EncoderSession *e, encode_options_t options); static FLAC__bool EncoderSession_process(EncoderSession *e, const FLAC__int32 * const buffer[], uint32_t samples); @@ -482,7 +481,6 @@ static FLAC__bool get_sample_info_wave(EncoderSession *e, encode_options_t optio data_bytes = ds64_data_size; } if(options.ignore_chunk_sizes) { - FLAC__ASSERT(!options.sector_align); if(data_bytes) { flac__utils_printf(stderr, 1, "%s: WARNING: 'data' chunk has non-zero size, using --ignore-chunk-sizes is probably a bad idea\n", e->inbasefilename, chunk_id); if(e->treat_warnings_as_errors) @@ -717,7 +715,6 @@ static FLAC__bool get_sample_info_aiff(EncoderSession *e, encode_options_t optio return false; data_bytes = xx; if(options.ignore_chunk_sizes) { - FLAC__ASSERT(!options.sector_align); if(data_bytes) { flac__utils_printf(stderr, 1, "%s: WARNING: 'SSND' chunk has non-zero size, using --ignore-chunk-sizes is probably a bad idea\n", e->inbasefilename, chunk_id); if(e->treat_warnings_as_errors) @@ -864,7 +861,6 @@ int flac__encode_file(FILE *infile, FLAC__off_t infilesize, const char *infilena { EncoderSession encoder_session; size_t channel_map[FLAC__MAX_CHANNELS]; - int info_align_carry = -1, info_align_zero = -1; if(!EncoderSession_construct(&encoder_session, options, infilesize, infile, infilename, outfilename, lookahead, lookahead_length)) return 1; @@ -946,34 +942,19 @@ int flac__encode_file(FILE *infile, FLAC__off_t infilesize, const char *infilena flac__utils_printf(stderr, 1, "%s: ERROR: unsupported bits-per-sample %u\n", encoder_session.inbasefilename, encoder_session.info.bits_per_sample-encoder_session.info.shift); return EncoderSession_finish_error(&encoder_session); } - if(options.sector_align) { - if(encoder_session.info.channels != 2) { - flac__utils_printf(stderr, 1, "%s: ERROR: file has %u channels, must be 2 for --sector-align\n", encoder_session.inbasefilename, encoder_session.info.channels); - return EncoderSession_finish_error(&encoder_session); - } - if(encoder_session.info.sample_rate != 44100) { - flac__utils_printf(stderr, 1, "%s: ERROR: file's sample rate is %u, must be 44100 for --sector-align\n", encoder_session.inbasefilename, encoder_session.info.sample_rate); - return EncoderSession_finish_error(&encoder_session); - } - if(encoder_session.info.bits_per_sample-encoder_session.info.shift != 16) { - flac__utils_printf(stderr, 1, "%s: ERROR: file has %u bits-per-sample, must be 16 for --sector-align\n", encoder_session.inbasefilename, encoder_session.info.bits_per_sample-encoder_session.info.shift); - return EncoderSession_finish_error(&encoder_session); - } - } { FLAC__uint64 total_samples_in_input; /* WATCHOUT: may be 0 to mean "unknown" */ FLAC__uint64 skip; FLAC__uint64 until; /* a value of 0 mean end-of-stream (i.e. --until=-0) */ uint32_t consecutive_eos_count = 0; - uint32_t align_remainder = 0; switch(options.format) { case FORMAT_RAW: if(infilesize < 0) total_samples_in_input = 0; else - total_samples_in_input = (FLAC__uint64)infilesize / encoder_session.info.bytes_per_wide_sample + *options.align_reservoir_samples; + total_samples_in_input = (FLAC__uint64)infilesize / encoder_session.info.bytes_per_wide_sample; break; case FORMAT_WAVE: case FORMAT_WAVE64: @@ -981,7 +962,7 @@ int flac__encode_file(FILE *infile, FLAC__off_t infilesize, const char *infilena case FORMAT_AIFF: case FORMAT_AIFF_C: /* truncation in the division removes any padding byte that was counted in encoder_session.fmt.iff.data_bytes */ - total_samples_in_input = encoder_session.fmt.iff.data_bytes / encoder_session.info.bytes_per_wide_sample + *options.align_reservoir_samples; + total_samples_in_input = encoder_session.fmt.iff.data_bytes / encoder_session.info.bytes_per_wide_sample; /* check for chunks trailing the audio data */ if(!options.ignore_chunk_sizes && !options.format_options.iff.foreign_metadata @@ -1004,7 +985,7 @@ int flac__encode_file(FILE *infile, FLAC__off_t infilesize, const char *infilena break; case FORMAT_FLAC: case FORMAT_OGGFLAC: - total_samples_in_input = encoder_session.fmt.flac.client_data.metadata_blocks[0]->data.stream_info.total_samples + *options.align_reservoir_samples; + total_samples_in_input = encoder_session.fmt.flac.client_data.metadata_blocks[0]->data.stream_info.total_samples; break; default: FLAC__ASSERT(0); @@ -1022,9 +1003,6 @@ int flac__encode_file(FILE *infile, FLAC__off_t infilesize, const char *infilena } FLAC__ASSERT(options.skip_specification.value.samples >= 0); skip = (FLAC__uint64)options.skip_specification.value.samples; - FLAC__ASSERT(!options.sector_align || (options.format != FORMAT_FLAC && options.format != FORMAT_OGGFLAC && skip == 0)); - /* *options.align_reservoir_samples will be 0 unless --sector-align is used */ - FLAC__ASSERT(options.sector_align || *options.align_reservoir_samples == 0); /* * now that we possibly know the input size, canonicalize the @@ -1033,7 +1011,6 @@ int flac__encode_file(FILE *infile, FLAC__off_t infilesize, const char *infilena if(!canonicalize_until_specification(&options.until_specification, encoder_session.inbasefilename, encoder_session.info.sample_rate, skip, total_samples_in_input)) return EncoderSession_finish_error(&encoder_session); until = (FLAC__uint64)options.until_specification.value.samples; - FLAC__ASSERT(!options.sector_align || until == 0); /* adjust encoding parameters based on skip and until values */ switch(options.format) { @@ -1077,21 +1054,12 @@ int flac__encode_file(FILE *infile, FLAC__off_t infilesize, const char *infilena if(until > 0) { const FLAC__uint64 trim = total_samples_in_input - until; FLAC__ASSERT(total_samples_in_input > 0); - FLAC__ASSERT(!options.sector_align); if(options.format == FORMAT_RAW) infilesize -= (FLAC__off_t)trim * encoder_session.info.bytes_per_wide_sample; else if(EncoderSession_format_is_iff(&encoder_session)) encoder_session.fmt.iff.data_bytes -= trim * encoder_session.info.bytes_per_wide_sample; encoder_session.total_samples_to_encode -= trim; } - if(options.sector_align && (options.format != FORMAT_RAW || infilesize >=0)) { /* for RAW, need to know the filesize */ - FLAC__ASSERT(skip == 0); /* asserted above too, but lest we forget */ - align_remainder = (uint32_t)(encoder_session.total_samples_to_encode % 588); - if(options.is_last_file) - encoder_session.total_samples_to_encode += (588-align_remainder); /* will pad with zeroes */ - else - encoder_session.total_samples_to_encode -= align_remainder; /* will stop short and carry over to next file */ - } switch(options.format) { case FORMAT_RAW: encoder_session.unencoded_size = encoder_session.total_samples_to_encode * encoder_session.info.bytes_per_wide_sample; @@ -1195,36 +1163,6 @@ int flac__encode_file(FILE *infile, FLAC__off_t infilesize, const char *infilena } } - /* - * first do any samples in the reservoir - */ - if(options.sector_align && *options.align_reservoir_samples > 0) { - FLAC__ASSERT(options.format != FORMAT_FLAC && options.format != FORMAT_OGGFLAC); /* check again */ - if(!EncoderSession_process(&encoder_session, (const FLAC__int32 * const *)options.align_reservoir, *options.align_reservoir_samples)) { - print_error_with_state(&encoder_session, "ERROR during encoding"); - return EncoderSession_finish_error(&encoder_session); - } - } - - /* - * decrement infilesize or the data_bytes counter if we need to align the file - */ - if(options.sector_align) { - if(options.is_last_file) { - *options.align_reservoir_samples = 0; - } - else { - *options.align_reservoir_samples = align_remainder; - if(options.format == FORMAT_RAW) { - FLAC__ASSERT(infilesize >= 0); - infilesize -= (FLAC__off_t)((*options.align_reservoir_samples) * encoder_session.info.bytes_per_wide_sample); - FLAC__ASSERT(infilesize >= 0); - } - else if(EncoderSession_format_is_iff(&encoder_session)) - encoder_session.fmt.iff.data_bytes -= (*options.align_reservoir_samples) * encoder_session.info.bytes_per_wide_sample; - } - } - /* * now do samples from the file */ @@ -1419,53 +1357,10 @@ int flac__encode_file(FILE *infile, FLAC__off_t infilesize, const char *infilena return EncoderSession_finish_error(&encoder_session); } - /* - * now read unaligned samples into reservoir or pad with zeroes if necessary - */ - if(options.sector_align) { - if(options.is_last_file) { - uint32_t wide_samples = 588 - align_remainder; - if(wide_samples < 588) { - uint32_t channel; - - info_align_zero = wide_samples; - for(channel = 0; channel < encoder_session.info.channels; channel++) - memset(input_[channel], 0, sizeof(input_[0][0]) * wide_samples); - - if(!EncoderSession_process(&encoder_session, (const FLAC__int32 * const *)input_, wide_samples)) { - print_error_with_state(&encoder_session, "ERROR during encoding"); - return EncoderSession_finish_error(&encoder_session); - } - } - } - else { - if(*options.align_reservoir_samples > 0) { - size_t bytes_read; - FLAC__ASSERT(CHUNK_OF_SAMPLES >= 588); - bytes_read = fread(ubuffer.u8, sizeof(uint8_t), (*options.align_reservoir_samples) * encoder_session.info.bytes_per_wide_sample, infile); - if(bytes_read == 0 && ferror(infile)) { - flac__utils_printf(stderr, 1, "%s: ERROR during read\n", encoder_session.inbasefilename); - return EncoderSession_finish_error(&encoder_session); - } - else if(bytes_read != (*options.align_reservoir_samples) * encoder_session.info.bytes_per_wide_sample) { - flac__utils_printf(stderr, 1, "%s: WARNING: unexpected EOF; read %" PRIu64 " bytes; expected %" PRIu64 " samples, got %" PRIu64 " samples\n", encoder_session.inbasefilename, bytes_read, encoder_session.total_samples_to_encode, encoder_session.samples_written); - if(encoder_session.treat_warnings_as_errors) - return EncoderSession_finish_error(&encoder_session); - } - else { - info_align_carry = *options.align_reservoir_samples; - if(!format_input(options.align_reservoir, *options.align_reservoir_samples, encoder_session.info.is_big_endian, encoder_session.info.is_unsigned_samples, encoder_session.info.channels, encoder_session.info.bits_per_sample, encoder_session.info.shift, channel_map)) - return EncoderSession_finish_error(&encoder_session); - } - } - } - } } return EncoderSession_finish_ok( &encoder_session, - info_align_carry, - info_align_zero, EncoderSession_format_is_iff(&encoder_session)? options.format_options.iff.foreign_metadata : 0, options.error_on_compression_fail ); @@ -1594,7 +1489,7 @@ void EncoderSession_destroy(EncoderSession *e) } } -int EncoderSession_finish_ok(EncoderSession *e, int info_align_carry, int info_align_zero, foreign_metadata_t *foreign_metadata, FLAC__bool error_on_compression_fail) +int EncoderSession_finish_ok(EncoderSession *e, foreign_metadata_t *foreign_metadata, FLAC__bool error_on_compression_fail) { FLAC__StreamEncoderState fse_state = FLAC__STREAM_ENCODER_OK; int ret = 0; @@ -1620,14 +1515,6 @@ int EncoderSession_finish_ok(EncoderSession *e, int info_align_carry, int info_a print_verify_error(e); ret = 1; } - else { - if(info_align_carry >= 0) { - flac__utils_printf(stderr, 1, "%s: INFO: sector alignment causing %d samples to be carried over\n", e->inbasefilename, info_align_carry); - } - if(info_align_zero >= 0) { - flac__utils_printf(stderr, 1, "%s: INFO: sector alignment causing %d zero samples to be appended\n", e->inbasefilename, info_align_zero); - } - } /*@@@@@@ should this go here or somewhere else? */ if(ret == 0 && foreign_metadata) { diff --git a/src/flac/encode.h b/src/flac/encode.h index 5cb2cb78..1b13cb85 100644 --- a/src/flac/encode.h +++ b/src/flac/encode.h @@ -76,14 +76,10 @@ typedef struct { FLAC__bool cued_seekpoints; FLAC__bool channel_map_none; /* --channel-map=none specified, eventually will expand to take actual channel map */ - /* options related to --replay-gain and --sector-align */ FLAC__bool is_first_file; FLAC__bool is_last_file; - FLAC__int32 **align_reservoir; - unsigned *align_reservoir_samples; FLAC__bool replay_gain; FLAC__bool ignore_chunk_sizes; - FLAC__bool sector_align; FLAC__bool error_on_compression_fail; FLAC__bool limit_min_bitrate; FLAC__bool relaxed_foreign_metadata_handling; diff --git a/src/flac/main.c b/src/flac/main.c index 2bc30355..8189c230 100644 --- a/src/flac/main.c +++ b/src/flac/main.c @@ -151,7 +151,6 @@ static struct share__option long_options_[] = { { "lax" , share__no_argument, 0, 0 }, { "replay-gain" , share__no_argument, 0, 0 }, { "ignore-chunk-sizes" , share__no_argument, 0, 0 }, - { "sector-align" , share__no_argument, 0, 0 }, /* DEPRECATED */ { "seekpoint" , share__required_argument, 0, 'S' }, { "padding" , share__required_argument, 0, 'P' }, #if FLAC__HAS_OGG @@ -194,7 +193,6 @@ static struct share__option long_options_[] = { { "no-keep-foreign-metadata" , share__no_argument, 0, 0 }, { "no-replay-gain" , share__no_argument, 0, 0 }, { "no-ignore-chunk-sizes" , share__no_argument, 0, 0 }, - { "no-sector-align" , share__no_argument, 0, 0 }, /* DEPRECATED */ { "no-utf8-convert" , share__no_argument, 0, 0 }, { "no-lax" , share__no_argument, 0, 0 }, #if FLAC__HAS_OGG @@ -257,7 +255,6 @@ static struct { FLAC__bool keep_foreign_metadata_if_present; FLAC__bool replay_gain; FLAC__bool ignore_chunk_sizes; - FLAC__bool sector_align; FLAC__bool utf8_convert; /* true by default, to convert tag strings from locale to utf-8, false if --no-utf8-convert used */ const char *cmdline_forced_outfilename; const char *output_prefix; @@ -302,10 +299,6 @@ static struct { * miscellaneous globals */ -static FLAC__int32 align_reservoir_0[588], align_reservoir_1[588]; /* for carrying over samples from --sector-align */ /* DEPRECATED */ -static FLAC__int32 *align_reservoir[2] = { align_reservoir_0, align_reservoir_1 }; -static uint32_t align_reservoir_samples = 0; /* 0 .. 587 */ - #ifndef FUZZ_TOOL_FLAC int main(int argc, char *argv[]) @@ -441,8 +434,6 @@ int do_it(void) if(option_values.ignore_chunk_sizes) { if(option_values.mode_decode) return usage_error("ERROR: --ignore-chunk-sizes only allowed for encoding\n"); - if(0 != option_values.sector_align) - return usage_error("ERROR: --ignore-chunk-sizes not allowed with --sector-align\n"); if(0 != option_values.until_specification) return usage_error("ERROR: --ignore-chunk-sizes not allowed with --until\n"); if(0 != option_values.cue_specification) @@ -450,22 +441,6 @@ int do_it(void) if(0 != option_values.cuesheet_filename) return usage_error("ERROR: --ignore-chunk-sizes not allowed with --cuesheet\n"); } - if(option_values.sector_align) { - if(option_values.mode_decode) - return usage_error("ERROR: --sector-align only allowed for encoding\n"); - if(0 != option_values.skip_specification) - return usage_error("ERROR: --sector-align not allowed with --skip\n"); - if(0 != option_values.until_specification) - return usage_error("ERROR: --sector-align not allowed with --until\n"); - if(0 != option_values.cue_specification) - return usage_error("ERROR: --sector-align not allowed with --cue\n"); - if(option_values.format_channels >= 0 && option_values.format_channels != 2) - return usage_error("ERROR: --sector-align can only be done with stereo input\n"); - if(option_values.format_bps >= 0 && option_values.format_bps != 16) - return usage_error("ERROR: --sector-align can only be done with 16-bit samples\n"); - if(option_values.format_sample_rate >= 0 && option_values.format_sample_rate != 44100) - return usage_error("ERROR: --sector-align can only be done with a sample rate of 44100\n"); - } if(option_values.replay_gain) { if(option_values.force_to_stdout) return usage_error("ERROR: --replay-gain not allowed with -c/--stdout\n"); @@ -605,7 +580,6 @@ FLAC__bool init_options(void) option_values.keep_foreign_metadata_if_present = false; option_values.replay_gain = false; option_values.ignore_chunk_sizes = false; - option_values.sector_align = false; option_values.utf8_convert = true; option_values.cmdline_forced_outfilename = 0; option_values.output_prefix = 0; @@ -824,11 +798,6 @@ int parse_option(int short_option, const char *long_option, const char *option_a else if(0 == strcmp(long_option, "ignore-chunk-sizes")) { option_values.ignore_chunk_sizes = true; } - else if(0 == strcmp(long_option, "sector-align")) { - flac__utils_printf(stderr, 1, "WARNING: --sector-align is DEPRECATED and may not exist in future versions of flac.\n"); - flac__utils_printf(stderr, 1, " shntool provides similar functionality\n"); - option_values.sector_align = true; - } #if FLAC__HAS_OGG else if(0 == strcmp(long_option, "ogg")) { option_values.use_ogg = true; @@ -911,9 +880,6 @@ int parse_option(int short_option, const char *long_option, const char *option_a else if(0 == strcmp(long_option, "no-ignore-chunk-sizes")) { option_values.ignore_chunk_sizes = false; } - else if(0 == strcmp(long_option, "no-sector-align")) { - option_values.sector_align = false; - } else if(0 == strcmp(long_option, "no-utf8-convert")) { option_values.utf8_convert = false; } @@ -1340,7 +1306,6 @@ void show_help(void) printf(" -V, --verify Verify a correct encoding\n"); printf(" --lax Allow encoder to generate non-Subset files\n"); printf(" --ignore-chunk-sizes Ignore data chunk sizes in WAVE/AIFF files\n"); - printf(" --sector-align (DEPRECATED) Align multiple files on sector boundaries\n"); printf(" --replay-gain Calculate ReplayGain & store in FLAC tags\n"); printf(" --cuesheet=FILENAME Import cuesheet and store in CUESHEET block\n"); printf(" --picture=SPECIFICATION Import picture and store in PICTURE block\n"); @@ -1406,7 +1371,6 @@ void show_help(void) printf(" --no-residual-gnuplot\n"); printf(" --no-residual-text\n"); printf(" --no-ignore-chunk-sizes\n"); - printf(" --no-sector-align\n"); printf(" --no-seektable\n"); printf(" --no-silent\n"); printf(" --no-force\n"); @@ -1549,10 +1513,6 @@ void show_explain(void) printf(" --ignore-chunk-sizes Ignore data chunk sizes in WAVE/AIFF files;\n"); printf(" useful when piping data from programs which\n"); printf(" generate bogus data chunk sizes.\n"); - printf(" --sector-align Align encoding of multiple CD format WAVE files\n"); - printf(" on sector boundaries. This option is DEPRECATED\n"); - printf(" and may not exist in future versions of flac.\n"); - printf(" shntool offers similar functionality.\n"); printf(" --replay-gain Calculate ReplayGain values and store them as\n"); printf(" FLAC tags. Title gains/peaks will be computed\n"); printf(" for each file, and an album gain/peak will be\n"); @@ -1773,7 +1733,6 @@ void show_explain(void) printf(" --no-residual-gnuplot\n"); printf(" --no-residual-text\n"); printf(" --no-ignore-chunk-sizes\n"); - printf(" --no-sector-align\n"); printf(" --no-seektable\n"); printf(" --no-silent\n"); printf(" --no-force\n"); @@ -1964,17 +1923,6 @@ int encode_file(const char *infilename, FLAC__bool is_first_file, FLAC__bool is_ } } - if(option_values.sector_align && (input_format == FORMAT_FLAC || input_format == FORMAT_OGGFLAC)) { - flac__utils_printf(stderr, 1, "ERROR: can't use --sector-align when the input file is FLAC or Ogg FLAC\n"); - conditional_fclose(encode_infile); - return 1; - } - if(option_values.sector_align && input_format == FORMAT_RAW && infilesize < 0) { - flac__utils_printf(stderr, 1, "ERROR: can't use --sector-align when the input size is unknown\n"); - conditional_fclose(encode_infile); - return 1; - } - if(input_format == FORMAT_RAW) { if(option_values.format_is_big_endian < 0 || option_values.format_is_unsigned_samples < 0 || option_values.format_channels < 0 || option_values.format_bps < 0 || option_values.format_sample_rate < 0) { conditional_fclose(encode_infile); @@ -2036,11 +1984,8 @@ int encode_file(const char *infilename, FLAC__bool is_first_file, FLAC__bool is_ encode_options.channel_map_none = option_values.channel_map_none; encode_options.is_first_file = is_first_file; encode_options.is_last_file = is_last_file; - encode_options.align_reservoir = align_reservoir; - encode_options.align_reservoir_samples = &align_reservoir_samples; encode_options.replay_gain = option_values.replay_gain; encode_options.ignore_chunk_sizes = option_values.ignore_chunk_sizes; - encode_options.sector_align = option_values.sector_align; encode_options.vorbis_comment = option_values.vorbis_comment; FLAC__ASSERT(sizeof(encode_options.pictures) >= sizeof(option_values.pictures)); memcpy(encode_options.pictures, option_values.pictures, sizeof(option_values.pictures)); diff --git a/test/test_flac.sh b/test/test_flac.sh index befc8dee..cfe51c0c 100755 --- a/test/test_flac.sh +++ b/test/test_flac.sh @@ -1092,45 +1092,12 @@ cp shortnoise.raw file0.raw cp shortnoise.raw file1.raw cp shortnoise.raw file2.raw rm -f shortnoise.raw -# create authoritative sector-aligned files for comparison -file0_samples=$(( (short_noise_cdda_samples / 588) * 588)) -file0_remainder=$((short_noise_cdda_samples - file0_samples)) -file1_samples=$(( ( ( file0_remainder + short_noise_cdda_samples ) / 588 ) * 588)) -file1_remainder=$((file0_remainder + short_noise_cdda_samples - file1_samples)) -file1_samples=$((file1_samples - file0_remainder)) -file2_samples=$(( ( ( file1_remainder + short_noise_cdda_samples ) / 588 ) * 588)) -file2_remainder=$(( file1_remainder + short_noise_cdda_samples - file2_samples)) -file2_samples=$((file2_samples - file1_remainder)) -if [ $file2_remainder != '0' ] ; then - file2_samples=$((file2_samples + file2_remainder)) - file2_remainder=$((588 - file2_remainder)) -fi - -dd if=file0.raw ibs=4 count=$file0_samples of=file0s.raw 2>/dev/null || $dddie -dd if=file0.raw ibs=4 count=$file0_remainder of=file1s.raw skip=$file0_samples 2>/dev/null || $dddie -dd if=file1.raw ibs=4 count=$file1_samples of=z.raw 2>/dev/null || $dddie -cat z.raw >> file1s.raw || die "ERROR: cat-ing sector-aligned files" -dd if=file1.raw ibs=4 count=$file1_remainder of=file2s.raw skip=$file1_samples 2>/dev/null || $dddie -dd if=file2.raw ibs=4 count=$file2_samples of=z.raw 2>/dev/null || $dddie -cat z.raw >> file2s.raw || die "ERROR: cat-ing sector-aligned files" -dd if=/dev/zero ibs=4 count=$file2_remainder of=z.raw 2>/dev/null || $dddie -cat z.raw >> file2s.raw || die "ERROR: cat-ing sector-aligned files" -rm -f z.raw - -convert_to_wav file0s "$multifile_format_encode --force --force-raw-format" "$SILENT --force --decode" || die "ERROR creating authoritative sector-aligned WAVE" -convert_to_wav file1s "$multifile_format_encode --force --force-raw-format" "$SILENT --force --decode" || die "ERROR creating authoritative sector-aligned WAVE" -convert_to_wav file2s "$multifile_format_encode --force --force-raw-format" "$SILENT --force --decode" || die "ERROR creating authoritative sector-aligned WAVE" - -convert_to_aiff file0s "$multifile_format_encode --force --force-raw-format" "$SILENT --force --decode" || die "ERROR creating authoritative sector-aligned AIFF" -convert_to_aiff file1s "$multifile_format_encode --force --force-raw-format" "$SILENT --force --decode" || die "ERROR creating authoritative sector-aligned AIFF" -convert_to_aiff file2s "$multifile_format_encode --force --force-raw-format" "$SILENT --force --decode" || die "ERROR creating authoritative sector-aligned AIFF" test_multifile () { input_type=$1 streamtype=$2 - sector_align=$3 - encode_options="$4" + encode_options="$3" extra_encode_options="" extra_decode_options="" @@ -1150,10 +1117,6 @@ test_multifile () suffix=flac fi - if [ $sector_align = sector_align ] ; then - encode_options="$encode_options --sector-align" - fi - if [ $input_type = flac ] || [ $input_type = ogg ] ; then CMP=md5cmp else @@ -1165,15 +1128,9 @@ test_multifile () done run_flac --force $encode_options $extra_encode_options file0x.$input_type file1x.$input_type file2x.$input_type || die "ERROR" run_flac --force --decode $extra_decode_options file0x.$suffix file1x.$suffix file2x.$suffix || die "ERROR" - if [ $sector_align != sector_align ] ; then - for n in 0 1 2 ; do - $CMP file$n.$input_type file${n}x.$input_type || die "ERROR: file mismatch on file #$n" - done - else - for n in 0 1 2 ; do - $CMP file${n}s.$input_type file${n}x.$input_type || die "ERROR: file mismatch on file #$n" - done - fi + for n in 0 1 2 ; do + $CMP file$n.$input_type file${n}x.$input_type || die "ERROR: file mismatch on file #$n" + done for n in 0 1 2 ; do rm -f file${n}x.$suffix file${n}x.$input_type done @@ -1186,36 +1143,20 @@ input_types="raw wav aiff flac" #@@@fi for input_type in $input_types ; do echo "Testing multiple $input_type files without verify..." - test_multifile $input_type flac no_sector_align "" + test_multifile $input_type flac "" echo "Testing multiple $input_type files with verify..." - test_multifile $input_type flac no_sector_align "--verify" - - if [ $input_type != flac ] && [ $input_type != ogg ] ; then # --sector-align not supported for FLAC input - echo "Testing multiple $input_type files with --sector-align, without verify..." - test_multifile $input_type flac sector_align "" - - echo "Testing multiple $input_type files with --sector-align, with verify..." - test_multifile $input_type flac sector_align "--verify" - fi + test_multifile $input_type flac "--verify" if [ $has_ogg = yes ] ; then echo "Testing multiple $input_type files with --ogg, without verify..." - test_multifile $input_type ogg no_sector_align "" + test_multifile $input_type ogg "" echo "Testing multiple $input_type files with --ogg, with verify..." - test_multifile $input_type ogg no_sector_align "--verify" - - if [ $input_type != flac ] ; then # --sector-align not supported for FLAC input - echo "Testing multiple $input_type files with --ogg and --sector-align, without verify..." - test_multifile $input_type ogg sector_align "" - - echo "Testing multiple $input_type files with --ogg and --sector-align, with verify..." - test_multifile $input_type ogg sector_align "--verify" - fi + test_multifile $input_type ogg "--verify" echo "Testing multiple $input_type files with --ogg and --serial-number, with verify..." - test_multifile $input_type ogg no_sector_align "--serial-number=321 --verify" + test_multifile $input_type ogg "--serial-number=321 --verify" fi done -- cgit v1.2.3 From 6a9c1664b37d1a395f510746123e46d2395f004a Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Thu, 1 Jun 2023 16:50:27 +0200 Subject: Check that seektable length > 0 --- src/libFLAC/stream_decoder.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/libFLAC/stream_decoder.c b/src/libFLAC/stream_decoder.c index 6c82cbd7..d66d2ccb 100644 --- a/src/libFLAC/stream_decoder.c +++ b/src/libFLAC/stream_decoder.c @@ -1415,12 +1415,14 @@ FLAC__bool read_metadata_(FLAC__StreamDecoder *decoder) /* just in case we already have a seek table, and reading the next one fails: */ decoder->private_->has_seek_table = false; - if(!read_metadata_seektable_(decoder, is_last, length)) - return false; + if(length > 0) { + if(!read_metadata_seektable_(decoder, is_last, length)) + return false; - decoder->private_->has_seek_table = true; - if(!decoder->private_->is_seeking && decoder->private_->metadata_filter[FLAC__METADATA_TYPE_SEEKTABLE] && decoder->private_->metadata_callback) - decoder->private_->metadata_callback(decoder, &decoder->private_->seek_table, decoder->private_->client_data); + decoder->private_->has_seek_table = true; + if(!decoder->private_->is_seeking && decoder->private_->metadata_filter[FLAC__METADATA_TYPE_SEEKTABLE] && decoder->private_->metadata_callback) + decoder->private_->metadata_callback(decoder, &decoder->private_->seek_table, decoder->private_->client_data); + } } else { FLAC__bool skip_it = !decoder->private_->metadata_filter[type]; -- cgit v1.2.3 From fd890034a5d3d7749e8e6cdf878317ea379b73ac Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Thu, 1 Jun 2023 19:16:03 +0200 Subject: Fix compression level 8 in API docs --- include/FLAC/stream_encoder.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/FLAC/stream_encoder.h b/include/FLAC/stream_encoder.h index 4ab4dce4..0dc94e1c 100644 --- a/include/FLAC/stream_encoder.h +++ b/include/FLAC/stream_encoder.h @@ -850,7 +850,7 @@ FLAC_API FLAC__bool FLAC__stream_encoder_set_sample_rate(FLAC__StreamEncoder *en * 5 true false tukey(0.5) 8 0 false false false 0 5 0 * 6 true false subdivide_tukey(2) 8 0 false false false 0 6 0 * 7 true false subdivide_tukey(2) 12 0 false false false 0 6 0 - * 8 true false subdivide_tukey(2) 12 0 false false false 0 6 0 + * 8 true false subdivide_tukey(3) 12 0 false false false 0 6 0 * * * \default \c 5 -- cgit v1.2.3 From c0fc3c73e27573d6ac5d3c1c201fa76d4928a491 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Tue, 6 Jun 2023 09:30:50 +0200 Subject: Update changelog --- CHANGELOG.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c8f4ee7..5dc44a66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This changelog is not exhaustive, review [the git commit log](https://github.com/xiph/flac/commits) for an exhaustive list of changes. -## git as of 2023-05-28 +## git as of 2023-06-05 As there have been additions to the libFLAC interfaces, the libFLAC version number is incremented to 13. The libFLAC++ version number stays at 10. @@ -10,6 +10,9 @@ As there have been additions to the libFLAC interfaces, the libFLAC version numb * All PowerPC-specific code has been removed, as it turned out those improvements didn't actually improve anything * Large improvements in encoder speed for all presets. The largest change is for the fastest presets and for 24-bit and 32-bit inputs. * Small improvement in decoder speed for BMI2-capable CPUs + * Various documentation fixes and cleanups (Mark Grassi, Jake Schmidt) + * Various fixes (Ozkan Sezer, Zhipeng Xue, orbea, Sam James, Harish Mahendrakar) + * Fix building on Universal Windows Platform (Dmitry Kostjučenko) * flac * A lot of small fixes for bugs found by fuzzing * Various improvements to the --keep-foreign-metadata and --keep-foreign-metadata-if-present options on decoding @@ -23,12 +26,12 @@ As there have been additions to the libFLAC interfaces, the libFLAC version numb * Warn on testing files when ID3v2 tags are found * Warn when data trails the audio data of a WAV/AIFF/RF64/W64 file * Fix output file not being deleted after error on Windows - * Fix compilation on UWP platform + * Removal of the --sector--align option * metaflac * A lot of small fixes for bugs found by fuzzing * Added options --append and --data-format, which makes it possible to copy metadata blocks from one FLAC file to another * Added option --remove-all-tags-except - * Added option --show-all-tags + * Added option --show-all-tags (harridu, Martijn van Beurden) * libFLAC * No longer write seektables to Ogg, even when specifically asked for. Seektables in Ogg are not defined * Add functions FLAC__metadata_object_set_raw and FLAC__metadata_object_get_raw to convert between blob and FLAC__StreamMetadata -- cgit v1.2.3 From 7f89a74cb240d86301b5ba017fdd4fbfaad5677e Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Tue, 6 Jun 2023 18:03:32 +0200 Subject: Slim down CI --- .github/workflows/action.yml | 67 ------------------------------------------- .github/workflows/options.yml | 50 ++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 67 deletions(-) create mode 100644 .github/workflows/options.yml diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index 54108fa5..c8bdbff8 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -3,37 +3,12 @@ name: GitHub Actions on: push: pull_request: - schedule: - - cron: '0 0 1 * *' jobs: build: strategy: matrix: - name: - [ - ubuntu-latest-gcc-autotools, - ubuntu-latest-clang-autotools, - ubuntu-latest-gcc-cmake, - ubuntu-latest-clang-cmake, - macos-latest-clang-autotools, - macos-latest-clang-cmake, - windows-latest-cmake, - ubuntu-latest-gcc-autotools-32-bit-words, - ubuntu-latest-clang-autotools-32-bit-words, - ubuntu-latest-gcc-cmake-32-bit-words, - ubuntu-latest-clang-cmake-32-bit-words, - macos-latest-clang-autotools-32-bit-words, - macos-latest-clang-cmake-32-bit-words - ] include: - - name: ubuntu-latest-gcc-autotools - os: ubuntu-latest - cc: gcc - cxx: g++ - build-system: autotools - configure-opts: '' - - name: ubuntu-latest-clang-autotools os: ubuntu-latest cc: clang @@ -79,48 +54,6 @@ jobs: build-system: cmake configure-opts: '-DBUILD_SHARED_LIBS=ON' - - name: ubuntu-latest-gcc-autotools-32-bit-words - os: ubuntu-latest - cc: gcc - cxx: g++ - build-system: autotools - configure-opts: --disable-64-bit-words - - - name: ubuntu-latest-clang-autotools-32-bit-words - os: ubuntu-latest - cc: clang - cxx: clang++ - build-system: autotools - configure-opts: --disable-64-bit-words - - - name: ubuntu-latest-gcc-cmake-32-bit-words - os: ubuntu-latest - cc: gcc - cxx: g++ - build-system: cmake - configure-opts: -DENABLE_64_BIT_WORDS=OFF - - - name: ubuntu-latest-clang-cmake-32-bit-words - os: ubuntu-latest - cc: clang - cxx: clang++ - build-system: cmake - configure-opts: -DENABLE_64_BIT_WORDS=OFF - - - name: macos-latest-clang-autotools-32-bit-words - os: macos-latest - cc: clang - cxx: clang++ - build-system: autotools - configure-opts: --disable-64-bit-words - - - name: macos-latest-clang-cmake-32-bit-words - os: macos-latest - cc: clang - cxx: clang++ - build-system: cmake - configure-opts: -DENABLE_64_BIT_WORDS=OFF - runs-on: ${{ matrix.os }} steps: diff --git a/.github/workflows/options.yml b/.github/workflows/options.yml new file mode 100644 index 00000000..d2c8673e --- /dev/null +++ b/.github/workflows/options.yml @@ -0,0 +1,50 @@ +name: GitHub Actions for specific options + +on: + push: + pull_request: + +jobs: + build: + strategy: + matrix: + include: + - name: 32-bit-words + cppflags: '' + configure-opts: --disable-64-bit-words + + - name: integer-only-library + cppflags: '-DFLAC__INTEGER_ONLY_LIBRARY' + configure-opts: '' + + - name: no-asm + cppflags: '' + configure-opts: --disable-asm-optimizations + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y libtool-bin libogg-dev + + - name: Build and run tests + env: + CPPFLAGS: ${{ matrix.cppflags }} + run: | + ./autogen.sh + ./configure --disable-thorough-tests ${{ matrix.configure-opts }} + make + make check + + - name: Upload logs on failure + uses: actions/upload-artifact@v2 + if: failure() + with: + name: flac-${{ github.sha }}-${{ github.run_id }}-logs + path: | + ./**/*.log + ./**/out*.meta -- cgit v1.2.3 From e00d9b881f3fb8a181699ada966e909ab6d689c0 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Tue, 6 Jun 2023 22:08:24 +0200 Subject: Update copyright year and maintainer status --- AUTHORS | 8 ++------ COPYING.Xiph | 2 +- Makefile.am | 2 +- README.md | 2 +- configure.ac | 2 +- doc/Makefile.am | 2 +- doc/doxygen.footer.html | 4 ++-- doc/images/Makefile.am | 2 +- examples/Makefile.am | 2 +- examples/c/Makefile.am | 2 +- examples/c/decode/Makefile.am | 2 +- examples/c/decode/file/Makefile.am | 2 +- examples/c/decode/file/main.c | 2 +- examples/c/encode/Makefile.am | 2 +- examples/c/encode/file/Makefile.am | 2 +- examples/c/encode/file/main.c | 2 +- examples/cpp/Makefile.am | 2 +- examples/cpp/decode/Makefile.am | 2 +- examples/cpp/decode/file/Makefile.am | 2 +- examples/cpp/decode/file/main.cpp | 2 +- examples/cpp/encode/Makefile.am | 2 +- examples/cpp/encode/file/Makefile.am | 2 +- examples/cpp/encode/file/main.cpp | 2 +- include/FLAC++/Makefile.am | 2 +- include/FLAC++/all.h | 2 +- include/FLAC++/decoder.h | 2 +- include/FLAC++/encoder.h | 2 +- include/FLAC++/export.h | 2 +- include/FLAC++/metadata.h | 2 +- include/FLAC/Makefile.am | 2 +- include/FLAC/all.h | 2 +- include/FLAC/assert.h | 2 +- include/FLAC/callback.h | 2 +- include/FLAC/export.h | 2 +- include/FLAC/format.h | 2 +- include/FLAC/metadata.h | 2 +- include/FLAC/ordinals.h | 2 +- include/FLAC/stream_decoder.h | 2 +- include/FLAC/stream_encoder.h | 2 +- include/Makefile.am | 2 +- include/share/alloc.h | 2 +- include/share/compat.h | 2 +- include/share/endswap.h | 2 +- include/share/grabbag.h | 2 +- include/share/grabbag/cuesheet.h | 2 +- include/share/grabbag/file.h | 2 +- include/share/grabbag/picture.h | 2 +- include/share/grabbag/replaygain.h | 2 +- include/share/grabbag/seektable.h | 2 +- include/share/macros.h | 2 +- include/share/private.h | 2 +- include/share/replaygain_synthesis.h | 2 +- include/share/safe_str.h | 2 +- include/share/win_utf8_io.h | 2 +- include/test_libs_common/file_utils_flac.h | 2 +- include/test_libs_common/metadata_utils.h | 2 +- m4/Makefile.am | 2 +- m4/bswap.m4 | 2 +- m4/endian.m4 | 2 +- m4/stack_protect.m4 | 2 +- man/Makefile.am | 2 +- microbench/Makefile.am | 2 +- microbench/benchmark_residual.c | 2 +- microbench/util.c | 2 +- microbench/util.h | 2 +- oss-fuzz/Makefile.am | 2 +- oss-fuzz/encoder_v2.cc | 2 +- oss-fuzz/metadata.cc | 2 +- oss-fuzz/seek.cc | 2 +- src/Makefile.am | 2 +- src/flac/Makefile.am | 2 +- src/flac/analyze.c | 2 +- src/flac/analyze.h | 2 +- src/flac/decode.c | 2 +- src/flac/decode.h | 2 +- src/flac/encode.c | 2 +- src/flac/encode.h | 2 +- src/flac/foreign_metadata.c | 2 +- src/flac/foreign_metadata.h | 2 +- src/flac/iffscan.c | 2 +- src/flac/local_string_utils.h | 2 +- src/flac/main.c | 6 +++--- src/flac/utils.c | 2 +- src/flac/utils.h | 2 +- src/flac/vorbiscomment.c | 2 +- src/flac/vorbiscomment.h | 2 +- src/libFLAC++/Makefile.am | 2 +- src/libFLAC++/metadata.cpp | 2 +- src/libFLAC++/stream_decoder.cpp | 2 +- src/libFLAC++/stream_encoder.cpp | 2 +- src/libFLAC/Makefile.am | 2 +- src/libFLAC/bitmath.c | 2 +- src/libFLAC/bitreader.c | 2 +- src/libFLAC/bitwriter.c | 2 +- src/libFLAC/cpu.c | 2 +- src/libFLAC/crc.c | 2 +- src/libFLAC/fixed.c | 2 +- src/libFLAC/fixed_intrin_avx2.c | 2 +- src/libFLAC/fixed_intrin_sse2.c | 2 +- src/libFLAC/fixed_intrin_sse42.c | 2 +- src/libFLAC/fixed_intrin_ssse3.c | 2 +- src/libFLAC/float.c | 2 +- src/libFLAC/format.c | 2 +- src/libFLAC/include/Makefile.am | 2 +- src/libFLAC/include/private/Makefile.am | 2 +- src/libFLAC/include/private/all.h | 2 +- src/libFLAC/include/private/bitmath.h | 2 +- src/libFLAC/include/private/bitreader.h | 2 +- src/libFLAC/include/private/bitwriter.h | 2 +- src/libFLAC/include/private/cpu.h | 2 +- src/libFLAC/include/private/crc.h | 2 +- src/libFLAC/include/private/fixed.h | 2 +- src/libFLAC/include/private/float.h | 2 +- src/libFLAC/include/private/format.h | 2 +- src/libFLAC/include/private/lpc.h | 2 +- src/libFLAC/include/private/macros.h | 2 +- src/libFLAC/include/private/memory.h | 2 +- src/libFLAC/include/private/metadata.h | 2 +- src/libFLAC/include/private/ogg_decoder_aspect.h | 2 +- src/libFLAC/include/private/ogg_encoder_aspect.h | 2 +- src/libFLAC/include/private/ogg_helper.h | 2 +- src/libFLAC/include/private/ogg_mapping.h | 2 +- src/libFLAC/include/private/stream_encoder.h | 2 +- src/libFLAC/include/private/stream_encoder_framing.h | 2 +- src/libFLAC/include/private/window.h | 2 +- src/libFLAC/include/protected/Makefile.am | 2 +- src/libFLAC/include/protected/all.h | 2 +- src/libFLAC/include/protected/stream_decoder.h | 2 +- src/libFLAC/include/protected/stream_encoder.h | 2 +- src/libFLAC/lpc.c | 2 +- src/libFLAC/lpc_intrin_avx2.c | 2 +- src/libFLAC/lpc_intrin_fma.c | 2 +- src/libFLAC/lpc_intrin_neon.c | 2 +- src/libFLAC/lpc_intrin_sse2.c | 2 +- src/libFLAC/lpc_intrin_sse41.c | 2 +- src/libFLAC/memory.c | 2 +- src/libFLAC/metadata_iterators.c | 2 +- src/libFLAC/metadata_object.c | 2 +- src/libFLAC/ogg_decoder_aspect.c | 2 +- src/libFLAC/ogg_encoder_aspect.c | 2 +- src/libFLAC/ogg_helper.c | 2 +- src/libFLAC/ogg_mapping.c | 2 +- src/libFLAC/stream_decoder.c | 2 +- src/libFLAC/stream_encoder.c | 2 +- src/libFLAC/stream_encoder_framing.c | 2 +- src/libFLAC/stream_encoder_intrin_avx2.c | 2 +- src/libFLAC/stream_encoder_intrin_sse2.c | 2 +- src/libFLAC/stream_encoder_intrin_ssse3.c | 2 +- src/libFLAC/window.c | 2 +- src/metaflac/Makefile.am | 2 +- src/metaflac/main.c | 2 +- src/metaflac/operations.c | 2 +- src/metaflac/operations.h | 2 +- src/metaflac/operations_shorthand.h | 2 +- src/metaflac/operations_shorthand_cuesheet.c | 2 +- src/metaflac/operations_shorthand_picture.c | 2 +- src/metaflac/operations_shorthand_seektable.c | 2 +- src/metaflac/operations_shorthand_streaminfo.c | 2 +- src/metaflac/operations_shorthand_vorbiscomment.c | 2 +- src/metaflac/options.c | 2 +- src/metaflac/options.h | 2 +- src/metaflac/usage.c | 4 ++-- src/metaflac/usage.h | 2 +- src/metaflac/utils.c | 2 +- src/metaflac/utils.h | 2 +- src/share/Makefile.am | 2 +- src/share/grabbag/alloc.c | 2 +- src/share/grabbag/cuesheet.c | 2 +- src/share/grabbag/file.c | 2 +- src/share/grabbag/picture.c | 2 +- src/share/grabbag/replaygain.c | 2 +- src/share/grabbag/seektable.c | 2 +- src/share/grabbag/snprintf.c | 2 +- src/share/replaygain_synthesis/replaygain_synthesis.c | 2 +- src/share/win_utf8_io/win_utf8_io.c | 2 +- src/test_grabbag/Makefile.am | 2 +- src/test_grabbag/cuesheet/Makefile.am | 2 +- src/test_grabbag/cuesheet/main.c | 2 +- src/test_grabbag/picture/Makefile.am | 2 +- src/test_grabbag/picture/main.c | 2 +- src/test_libFLAC++/Makefile.am | 2 +- src/test_libFLAC++/decoders.cpp | 2 +- src/test_libFLAC++/decoders.h | 2 +- src/test_libFLAC++/encoders.cpp | 2 +- src/test_libFLAC++/encoders.h | 2 +- src/test_libFLAC++/main.cpp | 2 +- src/test_libFLAC++/metadata.cpp | 2 +- src/test_libFLAC++/metadata.h | 2 +- src/test_libFLAC++/metadata_manip.cpp | 2 +- src/test_libFLAC++/metadata_object.cpp | 2 +- src/test_libFLAC/Makefile.am | 2 +- src/test_libFLAC/bitreader.c | 2 +- src/test_libFLAC/bitreader.h | 2 +- src/test_libFLAC/bitwriter.c | 2 +- src/test_libFLAC/bitwriter.h | 2 +- src/test_libFLAC/crc.c | 2 +- src/test_libFLAC/crc.h | 2 +- src/test_libFLAC/decoders.c | 2 +- src/test_libFLAC/decoders.h | 2 +- src/test_libFLAC/encoders.c | 2 +- src/test_libFLAC/encoders.h | 2 +- src/test_libFLAC/endswap.c | 2 +- src/test_libFLAC/endswap.h | 2 +- src/test_libFLAC/format.c | 2 +- src/test_libFLAC/format.h | 2 +- src/test_libFLAC/main.c | 2 +- src/test_libFLAC/md5.c | 2 +- src/test_libFLAC/md5.h | 2 +- src/test_libFLAC/metadata.c | 2 +- src/test_libFLAC/metadata.h | 2 +- src/test_libFLAC/metadata_manip.c | 2 +- src/test_libFLAC/metadata_object.c | 2 +- src/test_libs_common/Makefile.am | 2 +- src/test_libs_common/file_utils_flac.c | 2 +- src/test_libs_common/metadata_utils.c | 2 +- src/test_seeking/Makefile.am | 2 +- src/test_seeking/main.c | 2 +- src/test_streams/Makefile.am | 2 +- src/test_streams/main.c | 2 +- src/utils/Makefile.am | 2 +- src/utils/flacdiff/Makefile.am | 2 +- src/utils/flacdiff/main.cpp | 2 +- src/utils/flactimer/Makefile.am | 2 +- src/utils/flactimer/main.cpp | 2 +- test/Makefile.am | 2 +- test/common.sh.in | 2 +- test/cuesheets/Makefile.am | 2 +- test/flac-to-flac-metadata-test-files/Makefile.am | 2 +- test/foreign-metadata-test-files/Makefile.am | 2 +- test/generate_streams.sh | 2 +- test/metaflac-test-files/Makefile.am | 2 +- test/pictures/Makefile.am | 2 +- test/test_compression.sh | 2 +- test/test_flac.sh | 2 +- test/test_grabbag.sh | 2 +- test/test_libFLAC++.sh | 2 +- test/test_libFLAC.sh | 2 +- test/test_metaflac.sh | 2 +- test/test_replaygain.sh | 2 +- test/test_seeking.sh | 2 +- test/test_streams.sh | 2 +- 241 files changed, 246 insertions(+), 250 deletions(-) diff --git a/AUTHORS b/AUTHORS index 3c372867..34c5f897 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,6 +1,6 @@ /* FLAC - Free Lossless Audio Codec * Copyright (C) 2001-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This file is part the FLAC project. FLAC is comprised of several * components distributed under different licenses. The codec libraries @@ -27,6 +27,7 @@ https://gitlab.xiph.org/xiph/flac/commits Original author: Josh Coalson Maintainer 2012-2020: Erik de Castro Lopo +Maintainer from 2022: Martijn van Beurden Website : https://www.xiph.org/flac/ @@ -57,8 +58,3 @@ Other major contributors and their contributions: "Matt Zimmerman" * Libtool/autoconf/automake make system, flac man page - -"Martijn van Beurden" -* Compression improvements -* Fuzzer improvements and fixes for fuzz findings -* Implementation of 32 bps encoder and decoder diff --git a/COPYING.Xiph b/COPYING.Xiph index edd24f71..86629af1 100644 --- a/COPYING.Xiph +++ b/COPYING.Xiph @@ -1,5 +1,5 @@ Copyright (C) 2000-2009 Josh Coalson -Copyright (C) 2011-2022 Xiph.Org Foundation +Copyright (C) 2011-2023 Xiph.Org Foundation Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/Makefile.am b/Makefile.am index 36d823a8..3bb523e8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,6 @@ # FLAC - Free Lossless Audio Codec # Copyright (C) 2001-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This file is part the FLAC project. FLAC is comprised of several # components distributed under different licenses. The codec libraries diff --git a/README.md b/README.md index 89029e1d..2979862a 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ - + diff --git a/doc/images/Makefile.am b/doc/images/Makefile.am index 19a4bef7..1e30a5c3 100644 --- a/doc/images/Makefile.am +++ b/doc/images/Makefile.am @@ -1,6 +1,6 @@ # FLAC - Free Lossless Audio Codec # Copyright (C) 2001-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This file is part the FLAC project. FLAC is comprised of several # components distributed under different licenses. The codec libraries diff --git a/examples/Makefile.am b/examples/Makefile.am index a26b3eee..18b844fa 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -1,6 +1,6 @@ # FLAC - Free Lossless Audio Codec # Copyright (C) 2001-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This file is part the FLAC project. FLAC is comprised of several # components distributed under different licenses. The codec libraries diff --git a/examples/c/Makefile.am b/examples/c/Makefile.am index 94a72e3f..ced8f8ed 100644 --- a/examples/c/Makefile.am +++ b/examples/c/Makefile.am @@ -1,6 +1,6 @@ # FLAC - Free Lossless Audio Codec # Copyright (C) 2001-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This file is part the FLAC project. FLAC is comprised of several # components distributed under different licenses. The codec libraries diff --git a/examples/c/decode/Makefile.am b/examples/c/decode/Makefile.am index 0255a9e2..3c9499cb 100644 --- a/examples/c/decode/Makefile.am +++ b/examples/c/decode/Makefile.am @@ -1,6 +1,6 @@ # FLAC - Free Lossless Audio Codec # Copyright (C) 2001-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This file is part the FLAC project. FLAC is comprised of several # components distributed under different licenses. The codec libraries diff --git a/examples/c/decode/file/Makefile.am b/examples/c/decode/file/Makefile.am index 13d37ba1..b74a782b 100644 --- a/examples/c/decode/file/Makefile.am +++ b/examples/c/decode/file/Makefile.am @@ -1,6 +1,6 @@ # example_c_decode_file - Simple FLAC file decoder using libFLAC # Copyright (C) 2007-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License diff --git a/examples/c/decode/file/main.c b/examples/c/decode/file/main.c index 93514d4f..009b0d72 100644 --- a/examples/c/decode/file/main.c +++ b/examples/c/decode/file/main.c @@ -1,6 +1,6 @@ /* example_c_decode_file - Simple FLAC file decoder using libFLAC * Copyright (C) 2007-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/examples/c/encode/Makefile.am b/examples/c/encode/Makefile.am index 0255a9e2..3c9499cb 100644 --- a/examples/c/encode/Makefile.am +++ b/examples/c/encode/Makefile.am @@ -1,6 +1,6 @@ # FLAC - Free Lossless Audio Codec # Copyright (C) 2001-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This file is part the FLAC project. FLAC is comprised of several # components distributed under different licenses. The codec libraries diff --git a/examples/c/encode/file/Makefile.am b/examples/c/encode/file/Makefile.am index ddf454a0..1771f7c1 100644 --- a/examples/c/encode/file/Makefile.am +++ b/examples/c/encode/file/Makefile.am @@ -1,6 +1,6 @@ # example_c_encode_file - Simple FLAC file encoder using libFLAC # Copyright (C) 2007-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License diff --git a/examples/c/encode/file/main.c b/examples/c/encode/file/main.c index 6414a142..22532aba 100644 --- a/examples/c/encode/file/main.c +++ b/examples/c/encode/file/main.c @@ -1,6 +1,6 @@ /* example_c_encode_file - Simple FLAC file encoder using libFLAC * Copyright (C) 2007-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/examples/cpp/Makefile.am b/examples/cpp/Makefile.am index 94a72e3f..ced8f8ed 100644 --- a/examples/cpp/Makefile.am +++ b/examples/cpp/Makefile.am @@ -1,6 +1,6 @@ # FLAC - Free Lossless Audio Codec # Copyright (C) 2001-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This file is part the FLAC project. FLAC is comprised of several # components distributed under different licenses. The codec libraries diff --git a/examples/cpp/decode/Makefile.am b/examples/cpp/decode/Makefile.am index 0255a9e2..3c9499cb 100644 --- a/examples/cpp/decode/Makefile.am +++ b/examples/cpp/decode/Makefile.am @@ -1,6 +1,6 @@ # FLAC - Free Lossless Audio Codec # Copyright (C) 2001-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This file is part the FLAC project. FLAC is comprised of several # components distributed under different licenses. The codec libraries diff --git a/examples/cpp/decode/file/Makefile.am b/examples/cpp/decode/file/Makefile.am index aa44a94d..ff608530 100644 --- a/examples/cpp/decode/file/Makefile.am +++ b/examples/cpp/decode/file/Makefile.am @@ -1,6 +1,6 @@ # example_cpp_decode_file - Simple FLAC file decoder using libFLAC # Copyright (C) 2007-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License diff --git a/examples/cpp/decode/file/main.cpp b/examples/cpp/decode/file/main.cpp index bea4b7c5..d1c29958 100644 --- a/examples/cpp/decode/file/main.cpp +++ b/examples/cpp/decode/file/main.cpp @@ -1,6 +1,6 @@ /* example_cpp_decode_file - Simple FLAC file decoder using libFLAC * Copyright (C) 2007-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/examples/cpp/encode/Makefile.am b/examples/cpp/encode/Makefile.am index 0255a9e2..3c9499cb 100644 --- a/examples/cpp/encode/Makefile.am +++ b/examples/cpp/encode/Makefile.am @@ -1,6 +1,6 @@ # FLAC - Free Lossless Audio Codec # Copyright (C) 2001-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This file is part the FLAC project. FLAC is comprised of several # components distributed under different licenses. The codec libraries diff --git a/examples/cpp/encode/file/Makefile.am b/examples/cpp/encode/file/Makefile.am index 3e3e6a8a..f293d615 100644 --- a/examples/cpp/encode/file/Makefile.am +++ b/examples/cpp/encode/file/Makefile.am @@ -1,6 +1,6 @@ # example_cpp_encode_file - Simple FLAC file encoder using libFLAC # Copyright (C) 2007-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License diff --git a/examples/cpp/encode/file/main.cpp b/examples/cpp/encode/file/main.cpp index 5c62853b..c420d230 100644 --- a/examples/cpp/encode/file/main.cpp +++ b/examples/cpp/encode/file/main.cpp @@ -1,6 +1,6 @@ /* example_cpp_encode_file - Simple FLAC file encoder using libFLAC * Copyright (C) 2007-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/include/FLAC++/Makefile.am b/include/FLAC++/Makefile.am index f9e24b9e..ba5daa5b 100644 --- a/include/FLAC++/Makefile.am +++ b/include/FLAC++/Makefile.am @@ -1,6 +1,6 @@ # libFLAC++ - Free Lossless Audio Codec library # Copyright (C) 2002-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions diff --git a/include/FLAC++/all.h b/include/FLAC++/all.h index 47a06715..fa5bd416 100644 --- a/include/FLAC++/all.h +++ b/include/FLAC++/all.h @@ -1,6 +1,6 @@ /* libFLAC++ - Free Lossless Audio Codec library * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/include/FLAC++/decoder.h b/include/FLAC++/decoder.h index fee6a3b0..6f0bda99 100644 --- a/include/FLAC++/decoder.h +++ b/include/FLAC++/decoder.h @@ -1,6 +1,6 @@ /* libFLAC++ - Free Lossless Audio Codec library * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/include/FLAC++/encoder.h b/include/FLAC++/encoder.h index acd5230c..2400823d 100644 --- a/include/FLAC++/encoder.h +++ b/include/FLAC++/encoder.h @@ -1,6 +1,6 @@ /* libFLAC++ - Free Lossless Audio Codec library * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/include/FLAC++/export.h b/include/FLAC++/export.h index 3745692b..21d9d8b0 100644 --- a/include/FLAC++/export.h +++ b/include/FLAC++/export.h @@ -1,6 +1,6 @@ /* libFLAC++ - Free Lossless Audio Codec library * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/include/FLAC++/metadata.h b/include/FLAC++/metadata.h index 1599ec45..26bc4765 100644 --- a/include/FLAC++/metadata.h +++ b/include/FLAC++/metadata.h @@ -1,6 +1,6 @@ /* libFLAC++ - Free Lossless Audio Codec library * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/include/FLAC/Makefile.am b/include/FLAC/Makefile.am index c12c22d4..80ded619 100644 --- a/include/FLAC/Makefile.am +++ b/include/FLAC/Makefile.am @@ -1,6 +1,6 @@ # libFLAC - Free Lossless Audio Codec library # Copyright (C) 2000-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions diff --git a/include/FLAC/all.h b/include/FLAC/all.h index a6a012fc..277dcbc5 100644 --- a/include/FLAC/all.h +++ b/include/FLAC/all.h @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/include/FLAC/assert.h b/include/FLAC/assert.h index 7d458264..ee3ee080 100644 --- a/include/FLAC/assert.h +++ b/include/FLAC/assert.h @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2001-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/include/FLAC/callback.h b/include/FLAC/callback.h index d00878b6..a1c88259 100644 --- a/include/FLAC/callback.h +++ b/include/FLAC/callback.h @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2004-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/include/FLAC/export.h b/include/FLAC/export.h index adbde7b0..d14728a5 100644 --- a/include/FLAC/export.h +++ b/include/FLAC/export.h @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/include/FLAC/format.h b/include/FLAC/format.h index 2d548437..ef7c8b21 100644 --- a/include/FLAC/format.h +++ b/include/FLAC/format.h @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/include/FLAC/metadata.h b/include/FLAC/metadata.h index b7010342..4747a5f3 100644 --- a/include/FLAC/metadata.h +++ b/include/FLAC/metadata.h @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2001-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/include/FLAC/ordinals.h b/include/FLAC/ordinals.h index 494cc01f..d61aac57 100644 --- a/include/FLAC/ordinals.h +++ b/include/FLAC/ordinals.h @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/include/FLAC/stream_decoder.h b/include/FLAC/stream_decoder.h index f4e16488..2272bcac 100644 --- a/include/FLAC/stream_decoder.h +++ b/include/FLAC/stream_decoder.h @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/include/FLAC/stream_encoder.h b/include/FLAC/stream_encoder.h index 0dc94e1c..a0d02639 100644 --- a/include/FLAC/stream_encoder.h +++ b/include/FLAC/stream_encoder.h @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/include/Makefile.am b/include/Makefile.am index efcb6cc8..01c5c9b6 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,6 +1,6 @@ # FLAC - Free Lossless Audio Codec # Copyright (C) 2001-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This file is part the FLAC project. FLAC is comprised of several # components distributed under different licenses. The codec libraries diff --git a/include/share/alloc.h b/include/share/alloc.h index 02bdb300..b0da6941 100644 --- a/include/share/alloc.h +++ b/include/share/alloc.h @@ -1,6 +1,6 @@ /* alloc - Convenience routines for safely allocating memory * Copyright (C) 2007-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/include/share/compat.h b/include/share/compat.h index 5ef5524a..6ce23a5c 100644 --- a/include/share/compat.h +++ b/include/share/compat.h @@ -1,5 +1,5 @@ /* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2012-2022 Xiph.Org Foundation + * Copyright (C) 2012-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/include/share/endswap.h b/include/share/endswap.h index 35ffc62e..8687b9d7 100644 --- a/include/share/endswap.h +++ b/include/share/endswap.h @@ -1,5 +1,5 @@ /* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2012-2022 Xiph.Org Foundation + * Copyright (C) 2012-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/include/share/grabbag.h b/include/share/grabbag.h index fe88aa1b..6424fa97 100644 --- a/include/share/grabbag.h +++ b/include/share/grabbag.h @@ -1,6 +1,6 @@ /* grabbag - Convenience lib for various routines common to several tools * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/share/grabbag/cuesheet.h b/include/share/grabbag/cuesheet.h index 73a44037..d0eb94d4 100644 --- a/include/share/grabbag/cuesheet.h +++ b/include/share/grabbag/cuesheet.h @@ -1,6 +1,6 @@ /* grabbag - Convenience lib for various routines common to several tools * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/share/grabbag/file.h b/include/share/grabbag/file.h index abc758f4..9a2e086a 100644 --- a/include/share/grabbag/file.h +++ b/include/share/grabbag/file.h @@ -1,6 +1,6 @@ /* grabbag - Convenience lib for various routines common to several tools * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/share/grabbag/picture.h b/include/share/grabbag/picture.h index 05e1cb84..6bc4c391 100644 --- a/include/share/grabbag/picture.h +++ b/include/share/grabbag/picture.h @@ -1,6 +1,6 @@ /* grabbag - Convenience lib for various routines common to several tools * Copyright (C) 2006-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/include/share/grabbag/replaygain.h b/include/share/grabbag/replaygain.h index c5180dd0..90e7a8c9 100644 --- a/include/share/grabbag/replaygain.h +++ b/include/share/grabbag/replaygain.h @@ -1,6 +1,6 @@ /* grabbag - Convenience lib for various routines common to several tools * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/share/grabbag/seektable.h b/include/share/grabbag/seektable.h index b48cfa16..751995be 100644 --- a/include/share/grabbag/seektable.h +++ b/include/share/grabbag/seektable.h @@ -1,6 +1,6 @@ /* grabbag - Convenience lib for various routines common to several tools * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/share/macros.h b/include/share/macros.h index d7f88feb..3e7ee554 100644 --- a/include/share/macros.h +++ b/include/share/macros.h @@ -1,5 +1,5 @@ /* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2013-2022 Xiph.Org Foundation + * Copyright (C) 2013-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/include/share/private.h b/include/share/private.h index b4312756..5340d401 100644 --- a/include/share/private.h +++ b/include/share/private.h @@ -1,5 +1,5 @@ /* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2013-2022 Xiph.Org Foundation + * Copyright (C) 2013-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/include/share/replaygain_synthesis.h b/include/share/replaygain_synthesis.h index c7661e56..1701995d 100644 --- a/include/share/replaygain_synthesis.h +++ b/include/share/replaygain_synthesis.h @@ -1,6 +1,6 @@ /* replaygain_synthesis - Routines for applying ReplayGain to a signal * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/share/safe_str.h b/include/share/safe_str.h index f52472ea..85ecbdaf 100644 --- a/include/share/safe_str.h +++ b/include/share/safe_str.h @@ -1,5 +1,5 @@ /* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2013-2022 Xiph.Org Foundation + * Copyright (C) 2013-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/include/share/win_utf8_io.h b/include/share/win_utf8_io.h index 61b8ca3f..ed07386f 100644 --- a/include/share/win_utf8_io.h +++ b/include/share/win_utf8_io.h @@ -1,5 +1,5 @@ /* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2013-2022 Xiph.Org Foundation + * Copyright (C) 2013-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/include/test_libs_common/file_utils_flac.h b/include/test_libs_common/file_utils_flac.h index b8487074..5c59c98b 100644 --- a/include/test_libs_common/file_utils_flac.h +++ b/include/test_libs_common/file_utils_flac.h @@ -1,6 +1,6 @@ /* test_libFLAC - Unit tester for libFLAC * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/include/test_libs_common/metadata_utils.h b/include/test_libs_common/metadata_utils.h index 235ba128..1ed923a6 100644 --- a/include/test_libs_common/metadata_utils.h +++ b/include/test_libs_common/metadata_utils.h @@ -1,6 +1,6 @@ /* test_libFLAC - Unit tester for libFLAC * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/m4/Makefile.am b/m4/Makefile.am index c888fc59..1a25b7a9 100644 --- a/m4/Makefile.am +++ b/m4/Makefile.am @@ -1,6 +1,6 @@ # FLAC - Free Lossless Audio Codec # Copyright (C) 2006-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This file is part the FLAC project. FLAC is comprised of several # components distributed under different licenses. The codec libraries diff --git a/m4/bswap.m4 b/m4/bswap.m4 index 54bb8f0b..b1abae95 100644 --- a/m4/bswap.m4 +++ b/m4/bswap.m4 @@ -1,4 +1,4 @@ -dnl Copyright (C) 2012-2022 Xiph.Org Foundation +dnl Copyright (C) 2012-2023 Xiph.Org Foundation dnl dnl Redistribution and use in source and binary forms, with or without dnl modification, are permitted provided that the following conditions diff --git a/m4/endian.m4 b/m4/endian.m4 index 22e1c4c3..28fbf321 100644 --- a/m4/endian.m4 +++ b/m4/endian.m4 @@ -1,4 +1,4 @@ -dnl Copyright (C) 2012-2022 Xiph.Org Foundation +dnl Copyright (C) 2012-2023 Xiph.Org Foundation dnl dnl Redistribution and use in source and binary forms, with or without dnl modification, are permitted provided that the following conditions diff --git a/m4/stack_protect.m4 b/m4/stack_protect.m4 index 1a66aa26..cf8af664 100644 --- a/m4/stack_protect.m4 +++ b/m4/stack_protect.m4 @@ -1,4 +1,4 @@ -dnl Copyright (C) 2013-2022 Xiph.Org Foundation +dnl Copyright (C) 2013-2023 Xiph.Org Foundation dnl dnl Redistribution and use in source and binary forms, with or without dnl modification, are permitted provided that the following conditions diff --git a/man/Makefile.am b/man/Makefile.am index 2e8afe3f..50bacae9 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -1,6 +1,6 @@ # flac - Command-line FLAC encoder/decoder # Copyright (C) 2000-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License diff --git a/microbench/Makefile.am b/microbench/Makefile.am index ea20c73e..81de3adb 100644 --- a/microbench/Makefile.am +++ b/microbench/Makefile.am @@ -1,5 +1,5 @@ # FLAC - Free Lossless Audio Codec -# Copyright (C) 2015-2022 Xiph.Org Foundation +# Copyright (C) 2015-2023 Xiph.Org Foundation # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions diff --git a/microbench/benchmark_residual.c b/microbench/benchmark_residual.c index 4621461a..d9b19d7b 100644 --- a/microbench/benchmark_residual.c +++ b/microbench/benchmark_residual.c @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/microbench/util.c b/microbench/util.c index 31859f6d..2ecd4a35 100644 --- a/microbench/util.c +++ b/microbench/util.c @@ -1,5 +1,5 @@ /* FLAC - Free Lossless Audio Codec - * Copyright (C) 2015-2022 Xiph.Org Foundation + * Copyright (C) 2015-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/microbench/util.h b/microbench/util.h index 77984805..1fba4466 100644 --- a/microbench/util.h +++ b/microbench/util.h @@ -1,5 +1,5 @@ /* FLAC - Free Lossless Audio Codec - * Copyright (C) 2015-2022 Xiph.Org Foundation + * Copyright (C) 2015-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/oss-fuzz/Makefile.am b/oss-fuzz/Makefile.am index ef06486d..bf669aa3 100644 --- a/oss-fuzz/Makefile.am +++ b/oss-fuzz/Makefile.am @@ -1,5 +1,5 @@ # FLAC - Free Lossless Audio Codec -# Copyright (C) 2019-2022 Xiph.Org Foundation +# Copyright (C) 2019-2023 Xiph.Org Foundation # # This file is part the FLAC project. FLAC is comprised of several # components distributed under different licenses. The codec libraries diff --git a/oss-fuzz/encoder_v2.cc b/oss-fuzz/encoder_v2.cc index 3e8d07e1..64483461 100644 --- a/oss-fuzz/encoder_v2.cc +++ b/oss-fuzz/encoder_v2.cc @@ -1,5 +1,5 @@ /* fuzzer_encoder_v2 - * Copyright (C) 2022 Xiph.Org Foundation + * Copyright (C) 2022-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/oss-fuzz/metadata.cc b/oss-fuzz/metadata.cc index d03d6dbf..ad27fe95 100644 --- a/oss-fuzz/metadata.cc +++ b/oss-fuzz/metadata.cc @@ -1,5 +1,5 @@ /* fuzzer_metadata - * Copyright (C) 2022 Xiph.Org Foundation + * Copyright (C) 2022-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/oss-fuzz/seek.cc b/oss-fuzz/seek.cc index 33339030..d3ccbe88 100644 --- a/oss-fuzz/seek.cc +++ b/oss-fuzz/seek.cc @@ -1,5 +1,5 @@ /* fuzzer_seek - * Copyright (C) 2022 Xiph.Org Foundation + * Copyright (C) 2022-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/Makefile.am b/src/Makefile.am index c46a94fc..e9d60a9b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,6 +1,6 @@ # FLAC - Free Lossless Audio Codec # Copyright (C) 2001-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This file is part the FLAC project. FLAC is comprised of several # components distributed under different licenses. The codec libraries diff --git a/src/flac/Makefile.am b/src/flac/Makefile.am index eb1fa847..279a7cb9 100644 --- a/src/flac/Makefile.am +++ b/src/flac/Makefile.am @@ -1,6 +1,6 @@ # flac - Command-line FLAC encoder/decoder # Copyright (C) 2000-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License diff --git a/src/flac/analyze.c b/src/flac/analyze.c index 0f89f69e..0a85565e 100644 --- a/src/flac/analyze.c +++ b/src/flac/analyze.c @@ -1,6 +1,6 @@ /* flac - Command-line FLAC encoder/decoder * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/flac/analyze.h b/src/flac/analyze.h index fbdec29e..ce07b145 100644 --- a/src/flac/analyze.h +++ b/src/flac/analyze.h @@ -1,6 +1,6 @@ /* flac - Command-line FLAC encoder/decoder * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/flac/decode.c b/src/flac/decode.c index bb39fcd2..bc9c106c 100644 --- a/src/flac/decode.c +++ b/src/flac/decode.c @@ -1,6 +1,6 @@ /* flac - Command-line FLAC encoder/decoder * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/flac/decode.h b/src/flac/decode.h index 67bd3c04..24f5723d 100644 --- a/src/flac/decode.h +++ b/src/flac/decode.h @@ -1,6 +1,6 @@ /* flac - Command-line FLAC encoder/decoder * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/flac/encode.c b/src/flac/encode.c index 20bcc235..a945b356 100644 --- a/src/flac/encode.c +++ b/src/flac/encode.c @@ -1,6 +1,6 @@ /* flac - Command-line FLAC encoder/decoder * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/flac/encode.h b/src/flac/encode.h index 1b13cb85..2d65c506 100644 --- a/src/flac/encode.h +++ b/src/flac/encode.h @@ -1,6 +1,6 @@ /* flac - Command-line FLAC encoder/decoder * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/flac/foreign_metadata.c b/src/flac/foreign_metadata.c index 1cef901b..f63fc3e6 100644 --- a/src/flac/foreign_metadata.c +++ b/src/flac/foreign_metadata.c @@ -1,6 +1,6 @@ /* flac - Command-line FLAC encoder/decoder * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/flac/foreign_metadata.h b/src/flac/foreign_metadata.h index 83d8e81f..fa68d46f 100644 --- a/src/flac/foreign_metadata.h +++ b/src/flac/foreign_metadata.h @@ -1,6 +1,6 @@ /* flac - Command-line FLAC encoder/decoder * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/flac/iffscan.c b/src/flac/iffscan.c index 5b868fd1..a5472e0c 100644 --- a/src/flac/iffscan.c +++ b/src/flac/iffscan.c @@ -1,6 +1,6 @@ /* iffscan - Simple AIFF/RIFF chunk scanner * Copyright (C) 2007-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/flac/local_string_utils.h b/src/flac/local_string_utils.h index e869d701..01f891f7 100644 --- a/src/flac/local_string_utils.h +++ b/src/flac/local_string_utils.h @@ -1,6 +1,6 @@ /* flac - Command-line FLAC encoder/decoder * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/flac/main.c b/src/flac/main.c index 8189c230..c22e602c 100644 --- a/src/flac/main.c +++ b/src/flac/main.c @@ -1,6 +1,6 @@ /* flac - Command-line FLAC encoder/decoder * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -480,7 +480,7 @@ int do_it(void) flac__utils_printf(stderr, 2, "\n"); flac__utils_printf(stderr, 2, "flac %s\n", FLAC__VERSION_STRING); - flac__utils_printf(stderr, 2, "Copyright (C) 2000-2009 Josh Coalson, 2011-2022 Xiph.Org Foundation\n"); + flac__utils_printf(stderr, 2, "Copyright (C) 2000-2009 Josh Coalson, 2011-2023 Xiph.Org Foundation\n"); flac__utils_printf(stderr, 2, "flac comes with ABSOLUTELY NO WARRANTY. This is free software, and you are\n"); flac__utils_printf(stderr, 2, "welcome to redistribute it under certain conditions. Type `flac' for details.\n\n"); @@ -1212,7 +1212,7 @@ static void usage_header(void) printf("===============================================================================\n"); printf("flac - Command-line FLAC encoder/decoder version %s\n", FLAC__VERSION_STRING); printf("Copyright (C) 2000-2009 Josh Coalson\n"); - printf("Copyright (C) 2011-2022 Xiph.Org Foundation\n"); + printf("Copyright (C) 2011-2023 Xiph.Org Foundation\n"); printf("\n"); printf("This program is free software; you can redistribute it and/or\n"); printf("modify it under the terms of the GNU General Public License\n"); diff --git a/src/flac/utils.c b/src/flac/utils.c index da39bd4f..446150d4 100644 --- a/src/flac/utils.c +++ b/src/flac/utils.c @@ -1,6 +1,6 @@ /* flac - Command-line FLAC encoder/decoder * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/flac/utils.h b/src/flac/utils.h index ec87f567..931b4a6e 100644 --- a/src/flac/utils.h +++ b/src/flac/utils.h @@ -1,6 +1,6 @@ /* flac - Command-line FLAC encoder/decoder * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/flac/vorbiscomment.c b/src/flac/vorbiscomment.c index 434b5202..3941ec24 100644 --- a/src/flac/vorbiscomment.c +++ b/src/flac/vorbiscomment.c @@ -1,6 +1,6 @@ /* flac - Command-line FLAC encoder/decoder * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/flac/vorbiscomment.h b/src/flac/vorbiscomment.h index 6da6452d..a6dcb164 100644 --- a/src/flac/vorbiscomment.h +++ b/src/flac/vorbiscomment.h @@ -1,6 +1,6 @@ /* flac - Command-line FLAC encoder/decoder * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/libFLAC++/Makefile.am b/src/libFLAC++/Makefile.am index df4daa7e..692aeaac 100644 --- a/src/libFLAC++/Makefile.am +++ b/src/libFLAC++/Makefile.am @@ -1,6 +1,6 @@ # libFLAC++ - Free Lossless Audio Codec library # Copyright (C) 2002-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions diff --git a/src/libFLAC++/metadata.cpp b/src/libFLAC++/metadata.cpp index c6dd9372..beab1109 100644 --- a/src/libFLAC++/metadata.cpp +++ b/src/libFLAC++/metadata.cpp @@ -1,6 +1,6 @@ /* libFLAC++ - Free Lossless Audio Codec library * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC++/stream_decoder.cpp b/src/libFLAC++/stream_decoder.cpp index 7adb8107..6e351d94 100644 --- a/src/libFLAC++/stream_decoder.cpp +++ b/src/libFLAC++/stream_decoder.cpp @@ -1,6 +1,6 @@ /* libFLAC++ - Free Lossless Audio Codec library * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC++/stream_encoder.cpp b/src/libFLAC++/stream_encoder.cpp index 43ec1afd..83771294 100644 --- a/src/libFLAC++/stream_encoder.cpp +++ b/src/libFLAC++/stream_encoder.cpp @@ -1,6 +1,6 @@ /* libFLAC++ - Free Lossless Audio Codec library * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/Makefile.am b/src/libFLAC/Makefile.am index 89648dc7..1f03f038 100644 --- a/src/libFLAC/Makefile.am +++ b/src/libFLAC/Makefile.am @@ -1,6 +1,6 @@ # libFLAC - Free Lossless Audio Codec library # Copyright (C) 2001-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions diff --git a/src/libFLAC/bitmath.c b/src/libFLAC/bitmath.c index 7c73cc05..077486b6 100644 --- a/src/libFLAC/bitmath.c +++ b/src/libFLAC/bitmath.c @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2001-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/bitreader.c b/src/libFLAC/bitreader.c index e6e60abc..829b308e 100644 --- a/src/libFLAC/bitreader.c +++ b/src/libFLAC/bitreader.c @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/bitwriter.c b/src/libFLAC/bitwriter.c index 423faec8..1d7be808 100644 --- a/src/libFLAC/bitwriter.c +++ b/src/libFLAC/bitwriter.c @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/cpu.c b/src/libFLAC/cpu.c index a9d03d77..d088e3c0 100644 --- a/src/libFLAC/cpu.c +++ b/src/libFLAC/cpu.c @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2001-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/crc.c b/src/libFLAC/crc.c index 4f47e986..9e488e9b 100644 --- a/src/libFLAC/crc.c +++ b/src/libFLAC/crc.c @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/fixed.c b/src/libFLAC/fixed.c index d997640b..5c42570e 100644 --- a/src/libFLAC/fixed.c +++ b/src/libFLAC/fixed.c @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/fixed_intrin_avx2.c b/src/libFLAC/fixed_intrin_avx2.c index 9559f748..85fc4a6d 100644 --- a/src/libFLAC/fixed_intrin_avx2.c +++ b/src/libFLAC/fixed_intrin_avx2.c @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/fixed_intrin_sse2.c b/src/libFLAC/fixed_intrin_sse2.c index 89a9d72d..b92c13c1 100644 --- a/src/libFLAC/fixed_intrin_sse2.c +++ b/src/libFLAC/fixed_intrin_sse2.c @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/fixed_intrin_sse42.c b/src/libFLAC/fixed_intrin_sse42.c index f20c7dd3..0556eaad 100644 --- a/src/libFLAC/fixed_intrin_sse42.c +++ b/src/libFLAC/fixed_intrin_sse42.c @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/fixed_intrin_ssse3.c b/src/libFLAC/fixed_intrin_ssse3.c index 1f0e63dc..551693bf 100644 --- a/src/libFLAC/fixed_intrin_ssse3.c +++ b/src/libFLAC/fixed_intrin_ssse3.c @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/float.c b/src/libFLAC/float.c index 1e258275..a06ad285 100644 --- a/src/libFLAC/float.c +++ b/src/libFLAC/float.c @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2004-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/format.c b/src/libFLAC/format.c index 0c7ca0f6..b83f528f 100644 --- a/src/libFLAC/format.c +++ b/src/libFLAC/format.c @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/include/Makefile.am b/src/libFLAC/include/Makefile.am index 007a929b..8484d128 100644 --- a/src/libFLAC/include/Makefile.am +++ b/src/libFLAC/include/Makefile.am @@ -1,6 +1,6 @@ # libFLAC - Free Lossless Audio Codec library # Copyright (C) 2001-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions diff --git a/src/libFLAC/include/private/Makefile.am b/src/libFLAC/include/private/Makefile.am index 8e6755ea..3e63d310 100644 --- a/src/libFLAC/include/private/Makefile.am +++ b/src/libFLAC/include/private/Makefile.am @@ -1,6 +1,6 @@ # libFLAC - Free Lossless Audio Codec library # Copyright (C) 2001-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions diff --git a/src/libFLAC/include/private/all.h b/src/libFLAC/include/private/all.h index c64f9acd..10b69495 100644 --- a/src/libFLAC/include/private/all.h +++ b/src/libFLAC/include/private/all.h @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/include/private/bitmath.h b/src/libFLAC/include/private/bitmath.h index b1dc4e86..12e062f8 100644 --- a/src/libFLAC/include/private/bitmath.h +++ b/src/libFLAC/include/private/bitmath.h @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2001-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/include/private/bitreader.h b/src/libFLAC/include/private/bitreader.h index b450c27b..c36c9266 100644 --- a/src/libFLAC/include/private/bitreader.h +++ b/src/libFLAC/include/private/bitreader.h @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/include/private/bitwriter.h b/src/libFLAC/include/private/bitwriter.h index 6029790b..39bcf254 100644 --- a/src/libFLAC/include/private/bitwriter.h +++ b/src/libFLAC/include/private/bitwriter.h @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/include/private/cpu.h b/src/libFLAC/include/private/cpu.h index 4a79d64f..8843c74b 100644 --- a/src/libFLAC/include/private/cpu.h +++ b/src/libFLAC/include/private/cpu.h @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2001-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/include/private/crc.h b/src/libFLAC/include/private/crc.h index 8c8fcd4c..fe445020 100644 --- a/src/libFLAC/include/private/crc.h +++ b/src/libFLAC/include/private/crc.h @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/include/private/fixed.h b/src/libFLAC/include/private/fixed.h index 4ee1fd22..c4efecd5 100644 --- a/src/libFLAC/include/private/fixed.h +++ b/src/libFLAC/include/private/fixed.h @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/include/private/float.h b/src/libFLAC/include/private/float.h index 096db7d2..bec26345 100644 --- a/src/libFLAC/include/private/float.h +++ b/src/libFLAC/include/private/float.h @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2004-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/include/private/format.h b/src/libFLAC/include/private/format.h index d5c6aa49..7630f6fa 100644 --- a/src/libFLAC/include/private/format.h +++ b/src/libFLAC/include/private/format.h @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/include/private/lpc.h b/src/libFLAC/include/private/lpc.h index eed7b666..766f0560 100644 --- a/src/libFLAC/include/private/lpc.h +++ b/src/libFLAC/include/private/lpc.h @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/include/private/macros.h b/src/libFLAC/include/private/macros.h index ee0d997b..8204ed54 100644 --- a/src/libFLAC/include/private/macros.h +++ b/src/libFLAC/include/private/macros.h @@ -1,5 +1,5 @@ /* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2012-2022 Xiph.Org Foundation + * Copyright (C) 2012-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/include/private/memory.h b/src/libFLAC/include/private/memory.h index b55c9624..4221bcfd 100644 --- a/src/libFLAC/include/private/memory.h +++ b/src/libFLAC/include/private/memory.h @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2001-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/include/private/metadata.h b/src/libFLAC/include/private/metadata.h index 409b62cd..d3ceb53f 100644 --- a/src/libFLAC/include/private/metadata.h +++ b/src/libFLAC/include/private/metadata.h @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/include/private/ogg_decoder_aspect.h b/src/libFLAC/include/private/ogg_decoder_aspect.h index 2be979cc..c9236410 100644 --- a/src/libFLAC/include/private/ogg_decoder_aspect.h +++ b/src/libFLAC/include/private/ogg_decoder_aspect.h @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/include/private/ogg_encoder_aspect.h b/src/libFLAC/include/private/ogg_encoder_aspect.h index 35a1ddf5..0e9bb4bc 100644 --- a/src/libFLAC/include/private/ogg_encoder_aspect.h +++ b/src/libFLAC/include/private/ogg_encoder_aspect.h @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/include/private/ogg_helper.h b/src/libFLAC/include/private/ogg_helper.h index 3e15acca..67685787 100644 --- a/src/libFLAC/include/private/ogg_helper.h +++ b/src/libFLAC/include/private/ogg_helper.h @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec * Copyright (C) 2004-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/include/private/ogg_mapping.h b/src/libFLAC/include/private/ogg_mapping.h index 224f7dc2..1a213a4f 100644 --- a/src/libFLAC/include/private/ogg_mapping.h +++ b/src/libFLAC/include/private/ogg_mapping.h @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec * Copyright (C) 2004-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/include/private/stream_encoder.h b/src/libFLAC/include/private/stream_encoder.h index 1d22937e..0a1b672a 100644 --- a/src/libFLAC/include/private/stream_encoder.h +++ b/src/libFLAC/include/private/stream_encoder.h @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/include/private/stream_encoder_framing.h b/src/libFLAC/include/private/stream_encoder_framing.h index de2052ae..705965ae 100644 --- a/src/libFLAC/include/private/stream_encoder_framing.h +++ b/src/libFLAC/include/private/stream_encoder_framing.h @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/include/private/window.h b/src/libFLAC/include/private/window.h index 4aaaaea6..87a3fdf1 100644 --- a/src/libFLAC/include/private/window.h +++ b/src/libFLAC/include/private/window.h @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2006-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/include/protected/Makefile.am b/src/libFLAC/include/protected/Makefile.am index 30d03665..97e85a84 100644 --- a/src/libFLAC/include/protected/Makefile.am +++ b/src/libFLAC/include/protected/Makefile.am @@ -1,6 +1,6 @@ # libFLAC - Free Lossless Audio Codec library # Copyright (C) 2001-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions diff --git a/src/libFLAC/include/protected/all.h b/src/libFLAC/include/protected/all.h index ad302308..9f6de97a 100644 --- a/src/libFLAC/include/protected/all.h +++ b/src/libFLAC/include/protected/all.h @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2001-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/include/protected/stream_decoder.h b/src/libFLAC/include/protected/stream_decoder.h index f1c5d0eb..4a9c7686 100644 --- a/src/libFLAC/include/protected/stream_decoder.h +++ b/src/libFLAC/include/protected/stream_decoder.h @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/include/protected/stream_encoder.h b/src/libFLAC/include/protected/stream_encoder.h index 3e045583..863e43b3 100644 --- a/src/libFLAC/include/protected/stream_encoder.h +++ b/src/libFLAC/include/protected/stream_encoder.h @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2001-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/lpc.c b/src/libFLAC/lpc.c index 7c16cdf6..bcb8673c 100644 --- a/src/libFLAC/lpc.c +++ b/src/libFLAC/lpc.c @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/lpc_intrin_avx2.c b/src/libFLAC/lpc_intrin_avx2.c index 48bd7a85..7f1c03ed 100644 --- a/src/libFLAC/lpc_intrin_avx2.c +++ b/src/libFLAC/lpc_intrin_avx2.c @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/lpc_intrin_fma.c b/src/libFLAC/lpc_intrin_fma.c index 396ff302..c0740a88 100644 --- a/src/libFLAC/lpc_intrin_fma.c +++ b/src/libFLAC/lpc_intrin_fma.c @@ -1,5 +1,5 @@ /* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2022 Xiph.Org Foundation + * Copyright (C) 2022-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/lpc_intrin_neon.c b/src/libFLAC/lpc_intrin_neon.c index 0ba45016..b9945d58 100644 --- a/src/libFLAC/lpc_intrin_neon.c +++ b/src/libFLAC/lpc_intrin_neon.c @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/lpc_intrin_sse2.c b/src/libFLAC/lpc_intrin_sse2.c index f1ad018d..d16a085f 100644 --- a/src/libFLAC/lpc_intrin_sse2.c +++ b/src/libFLAC/lpc_intrin_sse2.c @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/lpc_intrin_sse41.c b/src/libFLAC/lpc_intrin_sse41.c index 136f71ca..756c5dd8 100644 --- a/src/libFLAC/lpc_intrin_sse41.c +++ b/src/libFLAC/lpc_intrin_sse41.c @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/memory.c b/src/libFLAC/memory.c index 2dad6e7d..ad5371ee 100644 --- a/src/libFLAC/memory.c +++ b/src/libFLAC/memory.c @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2001-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/metadata_iterators.c b/src/libFLAC/metadata_iterators.c index 16fa2f1d..20e926be 100644 --- a/src/libFLAC/metadata_iterators.c +++ b/src/libFLAC/metadata_iterators.c @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2001-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/metadata_object.c b/src/libFLAC/metadata_object.c index 95656697..73e76076 100644 --- a/src/libFLAC/metadata_object.c +++ b/src/libFLAC/metadata_object.c @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2001-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/ogg_decoder_aspect.c b/src/libFLAC/ogg_decoder_aspect.c index e331db30..58a29346 100644 --- a/src/libFLAC/ogg_decoder_aspect.c +++ b/src/libFLAC/ogg_decoder_aspect.c @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/ogg_encoder_aspect.c b/src/libFLAC/ogg_encoder_aspect.c index ae055c84..a88713b1 100644 --- a/src/libFLAC/ogg_encoder_aspect.c +++ b/src/libFLAC/ogg_encoder_aspect.c @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/ogg_helper.c b/src/libFLAC/ogg_helper.c index acd945ac..a4be34d2 100644 --- a/src/libFLAC/ogg_helper.c +++ b/src/libFLAC/ogg_helper.c @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec * Copyright (C) 2004-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/ogg_mapping.c b/src/libFLAC/ogg_mapping.c index 1bd8c3cb..756c7165 100644 --- a/src/libFLAC/ogg_mapping.c +++ b/src/libFLAC/ogg_mapping.c @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec * Copyright (C) 2004-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/stream_decoder.c b/src/libFLAC/stream_decoder.c index d66d2ccb..18d8dd3b 100644 --- a/src/libFLAC/stream_decoder.c +++ b/src/libFLAC/stream_decoder.c @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/stream_encoder.c b/src/libFLAC/stream_encoder.c index 0089753a..c1c03e49 100644 --- a/src/libFLAC/stream_encoder.c +++ b/src/libFLAC/stream_encoder.c @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/stream_encoder_framing.c b/src/libFLAC/stream_encoder_framing.c index 27a37c2f..0e07a317 100644 --- a/src/libFLAC/stream_encoder_framing.c +++ b/src/libFLAC/stream_encoder_framing.c @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/stream_encoder_intrin_avx2.c b/src/libFLAC/stream_encoder_intrin_avx2.c index 665f8036..b37efb38 100644 --- a/src/libFLAC/stream_encoder_intrin_avx2.c +++ b/src/libFLAC/stream_encoder_intrin_avx2.c @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/stream_encoder_intrin_sse2.c b/src/libFLAC/stream_encoder_intrin_sse2.c index fdab55b8..dd25fa65 100644 --- a/src/libFLAC/stream_encoder_intrin_sse2.c +++ b/src/libFLAC/stream_encoder_intrin_sse2.c @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/stream_encoder_intrin_ssse3.c b/src/libFLAC/stream_encoder_intrin_ssse3.c index 6f217521..241f723a 100644 --- a/src/libFLAC/stream_encoder_intrin_ssse3.c +++ b/src/libFLAC/stream_encoder_intrin_ssse3.c @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/libFLAC/window.c b/src/libFLAC/window.c index 4ee6f79d..69d5464a 100644 --- a/src/libFLAC/window.c +++ b/src/libFLAC/window.c @@ -1,6 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2006-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/metaflac/Makefile.am b/src/metaflac/Makefile.am index e5bee918..8c212ff4 100644 --- a/src/metaflac/Makefile.am +++ b/src/metaflac/Makefile.am @@ -1,6 +1,6 @@ # metaflac - Command-line FLAC metadata editor # Copyright (C) 2000-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License diff --git a/src/metaflac/main.c b/src/metaflac/main.c index 210c3b0d..bb662935 100644 --- a/src/metaflac/main.c +++ b/src/metaflac/main.c @@ -1,6 +1,6 @@ /* metaflac - Command-line FLAC metadata editor * Copyright (C) 2001-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/metaflac/operations.c b/src/metaflac/operations.c index e113ebc0..d81d87a7 100644 --- a/src/metaflac/operations.c +++ b/src/metaflac/operations.c @@ -1,6 +1,6 @@ /* metaflac - Command-line FLAC metadata editor * Copyright (C) 2001-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/metaflac/operations.h b/src/metaflac/operations.h index a5c1ebbb..79e1c3ba 100644 --- a/src/metaflac/operations.h +++ b/src/metaflac/operations.h @@ -1,6 +1,6 @@ /* metaflac - Command-line FLAC metadata editor * Copyright (C) 2001-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/metaflac/operations_shorthand.h b/src/metaflac/operations_shorthand.h index 6567efe2..1877c268 100644 --- a/src/metaflac/operations_shorthand.h +++ b/src/metaflac/operations_shorthand.h @@ -1,6 +1,6 @@ /* metaflac - Command-line FLAC metadata editor * Copyright (C) 2001-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/metaflac/operations_shorthand_cuesheet.c b/src/metaflac/operations_shorthand_cuesheet.c index 77390015..13c4dedb 100644 --- a/src/metaflac/operations_shorthand_cuesheet.c +++ b/src/metaflac/operations_shorthand_cuesheet.c @@ -1,6 +1,6 @@ /* metaflac - Command-line FLAC metadata editor * Copyright (C) 2001-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/metaflac/operations_shorthand_picture.c b/src/metaflac/operations_shorthand_picture.c index 10a5e786..6bb459ba 100644 --- a/src/metaflac/operations_shorthand_picture.c +++ b/src/metaflac/operations_shorthand_picture.c @@ -1,6 +1,6 @@ /* metaflac - Command-line FLAC metadata editor * Copyright (C) 2001-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/metaflac/operations_shorthand_seektable.c b/src/metaflac/operations_shorthand_seektable.c index 2f6241c9..c9175b36 100644 --- a/src/metaflac/operations_shorthand_seektable.c +++ b/src/metaflac/operations_shorthand_seektable.c @@ -1,6 +1,6 @@ /* metaflac - Command-line FLAC metadata editor * Copyright (C) 2001-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/metaflac/operations_shorthand_streaminfo.c b/src/metaflac/operations_shorthand_streaminfo.c index 0fe471ec..32198416 100644 --- a/src/metaflac/operations_shorthand_streaminfo.c +++ b/src/metaflac/operations_shorthand_streaminfo.c @@ -1,6 +1,6 @@ /* metaflac - Command-line FLAC metadata editor * Copyright (C) 2001-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/metaflac/operations_shorthand_vorbiscomment.c b/src/metaflac/operations_shorthand_vorbiscomment.c index 5a5ca8f4..27c9e4c8 100644 --- a/src/metaflac/operations_shorthand_vorbiscomment.c +++ b/src/metaflac/operations_shorthand_vorbiscomment.c @@ -1,6 +1,6 @@ /* metaflac - Command-line FLAC metadata editor * Copyright (C) 2001-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/metaflac/options.c b/src/metaflac/options.c index b2fb0f1b..1b4b6f62 100644 --- a/src/metaflac/options.c +++ b/src/metaflac/options.c @@ -1,6 +1,6 @@ /* metaflac - Command-line FLAC metadata editor * Copyright (C) 2001-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/metaflac/options.h b/src/metaflac/options.h index 7409f60a..984f2e11 100644 --- a/src/metaflac/options.h +++ b/src/metaflac/options.h @@ -1,6 +1,6 @@ /* metaflac - Command-line FLAC metadata editor * Copyright (C) 2001-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/metaflac/usage.c b/src/metaflac/usage.c index eeea946e..58afc0ea 100644 --- a/src/metaflac/usage.c +++ b/src/metaflac/usage.c @@ -1,6 +1,6 @@ /* metaflac - Command-line FLAC metadata editor * Copyright (C) 2001-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -33,7 +33,7 @@ static void usage_header(FILE *out) fprintf(out, "==============================================================================\n"); fprintf(out, "metaflac - Command-line FLAC metadata editor version %s\n", FLAC__VERSION_STRING); fprintf(out, "Copyright (C) 2001-2009 Josh Coalson\n"); - fprintf(out, "Copyright (C) 2011-2022 Xiph.Org Foundation\n"); + fprintf(out, "Copyright (C) 2011-2023 Xiph.Org Foundation\n"); fprintf(out, "\n"); fprintf(out, "This program is free software; you can redistribute it and/or\n"); fprintf(out, "modify it under the terms of the GNU General Public License\n"); diff --git a/src/metaflac/usage.h b/src/metaflac/usage.h index 86893edc..1366417a 100644 --- a/src/metaflac/usage.h +++ b/src/metaflac/usage.h @@ -1,6 +1,6 @@ /* metaflac - Command-line FLAC metadata editor * Copyright (C) 2001-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/metaflac/utils.c b/src/metaflac/utils.c index d819097e..045719a7 100644 --- a/src/metaflac/utils.c +++ b/src/metaflac/utils.c @@ -1,6 +1,6 @@ /* metaflac - Command-line FLAC metadata editor * Copyright (C) 2001-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/metaflac/utils.h b/src/metaflac/utils.h index cd2dfe4e..972a4501 100644 --- a/src/metaflac/utils.h +++ b/src/metaflac/utils.h @@ -1,6 +1,6 @@ /* metaflac - Command-line FLAC metadata editor * Copyright (C) 2001-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/share/Makefile.am b/src/share/Makefile.am index 412a7dff..caf61226 100644 --- a/src/share/Makefile.am +++ b/src/share/Makefile.am @@ -1,6 +1,6 @@ # FLAC - Free Lossless Audio Codec # Copyright (C) 2002-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This file is part the FLAC project. FLAC is comprised of several # components distributed under different licenses. The codec libraries diff --git a/src/share/grabbag/alloc.c b/src/share/grabbag/alloc.c index edf189a0..4e5fb60c 100644 --- a/src/share/grabbag/alloc.c +++ b/src/share/grabbag/alloc.c @@ -1,6 +1,6 @@ /* alloc - Convenience routines for safely allocating memory * Copyright (C) 2007-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/share/grabbag/cuesheet.c b/src/share/grabbag/cuesheet.c index c6bf50ef..0d19ee72 100644 --- a/src/share/grabbag/cuesheet.c +++ b/src/share/grabbag/cuesheet.c @@ -1,6 +1,6 @@ /* grabbag - Convenience lib for various routines common to several tools * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/share/grabbag/file.c b/src/share/grabbag/file.c index 1a781526..307645f5 100644 --- a/src/share/grabbag/file.c +++ b/src/share/grabbag/file.c @@ -1,6 +1,6 @@ /* grabbag - Convenience lib for various routines common to several tools * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/share/grabbag/picture.c b/src/share/grabbag/picture.c index 9be95ea3..9a4aafe2 100644 --- a/src/share/grabbag/picture.c +++ b/src/share/grabbag/picture.c @@ -1,6 +1,6 @@ /* grabbag - Convenience lib for various routines common to several tools * Copyright (C) 2006-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/share/grabbag/replaygain.c b/src/share/grabbag/replaygain.c index 6c58def1..32c96031 100644 --- a/src/share/grabbag/replaygain.c +++ b/src/share/grabbag/replaygain.c @@ -1,6 +1,6 @@ /* grabbag - Convenience lib for various routines common to several tools * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/share/grabbag/seektable.c b/src/share/grabbag/seektable.c index acc03fc7..01caa998 100644 --- a/src/share/grabbag/seektable.c +++ b/src/share/grabbag/seektable.c @@ -1,6 +1,6 @@ /* grabbag - Convenience lib for various routines common to several tools * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/share/grabbag/snprintf.c b/src/share/grabbag/snprintf.c index 4453a1bd..bd7ffba8 100644 --- a/src/share/grabbag/snprintf.c +++ b/src/share/grabbag/snprintf.c @@ -1,5 +1,5 @@ /* grabbag - Convenience lib for various routines common to several tools - * Copyright (C) 2013-2022 Xiph.Org Foundation + * Copyright (C) 2013-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/share/replaygain_synthesis/replaygain_synthesis.c b/src/share/replaygain_synthesis/replaygain_synthesis.c index 328afd10..8d4fda6b 100644 --- a/src/share/replaygain_synthesis/replaygain_synthesis.c +++ b/src/share/replaygain_synthesis/replaygain_synthesis.c @@ -1,6 +1,6 @@ /* replaygain_synthesis - Routines for applying ReplayGain to a signal * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/share/win_utf8_io/win_utf8_io.c b/src/share/win_utf8_io/win_utf8_io.c index 4896a362..3ae35b31 100644 --- a/src/share/win_utf8_io/win_utf8_io.c +++ b/src/share/win_utf8_io/win_utf8_io.c @@ -1,5 +1,5 @@ /* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2013-2022 Xiph.Org Foundation + * Copyright (C) 2013-2023 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/test_grabbag/Makefile.am b/src/test_grabbag/Makefile.am index 74e21ce3..ea710091 100644 --- a/src/test_grabbag/Makefile.am +++ b/src/test_grabbag/Makefile.am @@ -1,6 +1,6 @@ # FLAC - Free Lossless Audio Codec # Copyright (C) 2002-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This file is part the FLAC project. FLAC is comprised of several # components distributed under different licenses. The codec libraries diff --git a/src/test_grabbag/cuesheet/Makefile.am b/src/test_grabbag/cuesheet/Makefile.am index e9d2465a..1cee3707 100644 --- a/src/test_grabbag/cuesheet/Makefile.am +++ b/src/test_grabbag/cuesheet/Makefile.am @@ -1,6 +1,6 @@ # test_cuesheet - Simple tester for cuesheet routines in grabbag # Copyright (C) 2002-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License diff --git a/src/test_grabbag/cuesheet/main.c b/src/test_grabbag/cuesheet/main.c index b40ead8b..b3d0e9ab 100644 --- a/src/test_grabbag/cuesheet/main.c +++ b/src/test_grabbag/cuesheet/main.c @@ -1,6 +1,6 @@ /* test_cuesheet - Simple tester for cuesheet routines in grabbag * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/test_grabbag/picture/Makefile.am b/src/test_grabbag/picture/Makefile.am index 1e336595..45e14571 100644 --- a/src/test_grabbag/picture/Makefile.am +++ b/src/test_grabbag/picture/Makefile.am @@ -1,6 +1,6 @@ # test_picture - Simple tester for picture routines in grabbag # Copyright (C) 2006-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License diff --git a/src/test_grabbag/picture/main.c b/src/test_grabbag/picture/main.c index 6b8b17a2..fe43be94 100644 --- a/src/test_grabbag/picture/main.c +++ b/src/test_grabbag/picture/main.c @@ -1,6 +1,6 @@ /* test_picture - Simple tester for picture routines in grabbag * Copyright (C) 2006-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/test_libFLAC++/Makefile.am b/src/test_libFLAC++/Makefile.am index a27f1fa7..8bf746f7 100644 --- a/src/test_libFLAC++/Makefile.am +++ b/src/test_libFLAC++/Makefile.am @@ -1,6 +1,6 @@ # test_libFLAC++ - Unit tester for libFLAC++ # Copyright (C) 2002-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License diff --git a/src/test_libFLAC++/decoders.cpp b/src/test_libFLAC++/decoders.cpp index 59b746a1..9f375f34 100644 --- a/src/test_libFLAC++/decoders.cpp +++ b/src/test_libFLAC++/decoders.cpp @@ -1,6 +1,6 @@ /* test_libFLAC++ - Unit tester for libFLAC++ * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/test_libFLAC++/decoders.h b/src/test_libFLAC++/decoders.h index dad7cfad..4bbce132 100644 --- a/src/test_libFLAC++/decoders.h +++ b/src/test_libFLAC++/decoders.h @@ -1,6 +1,6 @@ /* test_libFLAC++ - Unit tester for libFLAC++ * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/test_libFLAC++/encoders.cpp b/src/test_libFLAC++/encoders.cpp index dd3d1106..0e356afe 100644 --- a/src/test_libFLAC++/encoders.cpp +++ b/src/test_libFLAC++/encoders.cpp @@ -1,6 +1,6 @@ /* test_libFLAC++ - Unit tester for libFLAC++ * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/test_libFLAC++/encoders.h b/src/test_libFLAC++/encoders.h index c03cbc50..9da415c5 100644 --- a/src/test_libFLAC++/encoders.h +++ b/src/test_libFLAC++/encoders.h @@ -1,6 +1,6 @@ /* test_libFLAC++ - Unit tester for libFLAC++ * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/test_libFLAC++/main.cpp b/src/test_libFLAC++/main.cpp index 5496250f..7183def7 100644 --- a/src/test_libFLAC++/main.cpp +++ b/src/test_libFLAC++/main.cpp @@ -1,6 +1,6 @@ /* test_libFLAC++ - Unit tester for libFLAC++ * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/test_libFLAC++/metadata.cpp b/src/test_libFLAC++/metadata.cpp index c4d9bfb0..a31031b6 100644 --- a/src/test_libFLAC++/metadata.cpp +++ b/src/test_libFLAC++/metadata.cpp @@ -1,6 +1,6 @@ /* test_libFLAC++ - Unit tester for libFLAC++ * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/test_libFLAC++/metadata.h b/src/test_libFLAC++/metadata.h index 7c8ac92b..8c45bc0a 100644 --- a/src/test_libFLAC++/metadata.h +++ b/src/test_libFLAC++/metadata.h @@ -1,6 +1,6 @@ /* test_libFLAC++ - Unit tester for libFLAC++ * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/test_libFLAC++/metadata_manip.cpp b/src/test_libFLAC++/metadata_manip.cpp index 95fe153f..5d395dbd 100644 --- a/src/test_libFLAC++/metadata_manip.cpp +++ b/src/test_libFLAC++/metadata_manip.cpp @@ -1,6 +1,6 @@ /* test_libFLAC++ - Unit tester for libFLAC++ * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/test_libFLAC++/metadata_object.cpp b/src/test_libFLAC++/metadata_object.cpp index ba7fbe50..ab4cfbfe 100644 --- a/src/test_libFLAC++/metadata_object.cpp +++ b/src/test_libFLAC++/metadata_object.cpp @@ -1,6 +1,6 @@ /* test_libFLAC++ - Unit tester for libFLAC++ * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/test_libFLAC/Makefile.am b/src/test_libFLAC/Makefile.am index bbbf6c6c..c77f87e8 100644 --- a/src/test_libFLAC/Makefile.am +++ b/src/test_libFLAC/Makefile.am @@ -1,6 +1,6 @@ # test_libFLAC - Unit tester for libFLAC # Copyright (C) 2000-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License diff --git a/src/test_libFLAC/bitreader.c b/src/test_libFLAC/bitreader.c index bae98675..d40bd1f2 100644 --- a/src/test_libFLAC/bitreader.c +++ b/src/test_libFLAC/bitreader.c @@ -1,6 +1,6 @@ /* test_libFLAC - Unit tester for libFLAC * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/test_libFLAC/bitreader.h b/src/test_libFLAC/bitreader.h index 1d7c90bc..f497acf6 100644 --- a/src/test_libFLAC/bitreader.h +++ b/src/test_libFLAC/bitreader.h @@ -1,6 +1,6 @@ /* test_libFLAC - Unit tester for libFLAC * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/test_libFLAC/bitwriter.c b/src/test_libFLAC/bitwriter.c index f3466139..0aafff2f 100644 --- a/src/test_libFLAC/bitwriter.c +++ b/src/test_libFLAC/bitwriter.c @@ -1,6 +1,6 @@ /* test_libFLAC - Unit tester for libFLAC * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/test_libFLAC/bitwriter.h b/src/test_libFLAC/bitwriter.h index 1e081cf6..9b6a8248 100644 --- a/src/test_libFLAC/bitwriter.h +++ b/src/test_libFLAC/bitwriter.h @@ -1,6 +1,6 @@ /* test_libFLAC - Unit tester for libFLAC * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/test_libFLAC/crc.c b/src/test_libFLAC/crc.c index 03d9adaf..8b876711 100644 --- a/src/test_libFLAC/crc.c +++ b/src/test_libFLAC/crc.c @@ -1,5 +1,5 @@ /* test_libFLAC - Unit tester for libFLAC - * Copyright (C) 2014-2022 Xiph.Org Foundation + * Copyright (C) 2014-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/test_libFLAC/crc.h b/src/test_libFLAC/crc.h index b4e35276..11523cd8 100644 --- a/src/test_libFLAC/crc.h +++ b/src/test_libFLAC/crc.h @@ -1,5 +1,5 @@ /* test_libFLAC - Unit tester for libFLAC - * Copyright (C) 2014-2022 Xiph.Org Foundation + * Copyright (C) 2014-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/test_libFLAC/decoders.c b/src/test_libFLAC/decoders.c index c353e6fc..ae114ced 100644 --- a/src/test_libFLAC/decoders.c +++ b/src/test_libFLAC/decoders.c @@ -1,6 +1,6 @@ /* test_libFLAC - Unit tester for libFLAC * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/test_libFLAC/decoders.h b/src/test_libFLAC/decoders.h index d77ae80d..431eb176 100644 --- a/src/test_libFLAC/decoders.h +++ b/src/test_libFLAC/decoders.h @@ -1,6 +1,6 @@ /* test_libFLAC - Unit tester for libFLAC * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/test_libFLAC/encoders.c b/src/test_libFLAC/encoders.c index 7f6e5ff7..d3fd39dd 100644 --- a/src/test_libFLAC/encoders.c +++ b/src/test_libFLAC/encoders.c @@ -1,6 +1,6 @@ /* test_libFLAC - Unit tester for libFLAC * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/test_libFLAC/encoders.h b/src/test_libFLAC/encoders.h index 882b34ac..7bdcaf5c 100644 --- a/src/test_libFLAC/encoders.h +++ b/src/test_libFLAC/encoders.h @@ -1,6 +1,6 @@ /* test_libFLAC - Unit tester for libFLAC * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/test_libFLAC/endswap.c b/src/test_libFLAC/endswap.c index d569197d..808f81f3 100644 --- a/src/test_libFLAC/endswap.c +++ b/src/test_libFLAC/endswap.c @@ -1,5 +1,5 @@ /* test_libFLAC - Unit tester for libFLAC - * Copyright (C) 2014-2022 Xiph.Org Foundation + * Copyright (C) 2014-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/test_libFLAC/endswap.h b/src/test_libFLAC/endswap.h index 1814f628..952b17f0 100644 --- a/src/test_libFLAC/endswap.h +++ b/src/test_libFLAC/endswap.h @@ -1,5 +1,5 @@ /* test_libFLAC - Unit tester for libFLAC - * Copyright (C) 2014-2022 Xiph.Org Foundation + * Copyright (C) 2014-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/test_libFLAC/format.c b/src/test_libFLAC/format.c index af447139..c5e8bf27 100644 --- a/src/test_libFLAC/format.c +++ b/src/test_libFLAC/format.c @@ -1,6 +1,6 @@ /* test_libFLAC - Unit tester for libFLAC * Copyright (C) 2004-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/test_libFLAC/format.h b/src/test_libFLAC/format.h index a37b675c..f78d55df 100644 --- a/src/test_libFLAC/format.h +++ b/src/test_libFLAC/format.h @@ -1,6 +1,6 @@ /* test_libFLAC - Unit tester for libFLAC * Copyright (C) 2004-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/test_libFLAC/main.c b/src/test_libFLAC/main.c index f7f3fe52..a4be0fee 100644 --- a/src/test_libFLAC/main.c +++ b/src/test_libFLAC/main.c @@ -1,6 +1,6 @@ /* test_libFLAC - Unit tester for libFLAC * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/test_libFLAC/md5.c b/src/test_libFLAC/md5.c index 39684e56..bac4a74a 100644 --- a/src/test_libFLAC/md5.c +++ b/src/test_libFLAC/md5.c @@ -1,5 +1,5 @@ /* test_libFLAC - Unit tester for libFLAC - * Copyright (C) 2014-2022 Xiph.Org Foundation + * Copyright (C) 2014-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/test_libFLAC/md5.h b/src/test_libFLAC/md5.h index f1aff45f..6863268d 100644 --- a/src/test_libFLAC/md5.h +++ b/src/test_libFLAC/md5.h @@ -1,5 +1,5 @@ /* test_libFLAC - Unit tester for libFLAC - * Copyright (C) 2014-2022 Xiph.Org Foundation + * Copyright (C) 2014-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/test_libFLAC/metadata.c b/src/test_libFLAC/metadata.c index 143ded46..0347f6d2 100644 --- a/src/test_libFLAC/metadata.c +++ b/src/test_libFLAC/metadata.c @@ -1,6 +1,6 @@ /* test_libFLAC - Unit tester for libFLAC * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/test_libFLAC/metadata.h b/src/test_libFLAC/metadata.h index 809e9801..51bdf7aa 100644 --- a/src/test_libFLAC/metadata.h +++ b/src/test_libFLAC/metadata.h @@ -1,6 +1,6 @@ /* test_libFLAC - Unit tester for libFLAC * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/test_libFLAC/metadata_manip.c b/src/test_libFLAC/metadata_manip.c index 52ce3a75..334dc3ae 100644 --- a/src/test_libFLAC/metadata_manip.c +++ b/src/test_libFLAC/metadata_manip.c @@ -1,6 +1,6 @@ /* test_libFLAC - Unit tester for libFLAC * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/test_libFLAC/metadata_object.c b/src/test_libFLAC/metadata_object.c index a538480c..ea6b69fd 100644 --- a/src/test_libFLAC/metadata_object.c +++ b/src/test_libFLAC/metadata_object.c @@ -1,6 +1,6 @@ /* test_libFLAC - Unit tester for libFLAC * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/test_libs_common/Makefile.am b/src/test_libs_common/Makefile.am index 667734de..30e1f157 100644 --- a/src/test_libs_common/Makefile.am +++ b/src/test_libs_common/Makefile.am @@ -1,6 +1,6 @@ # test_libs_common - Common code to library unit tests # Copyright (C) 2000-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License diff --git a/src/test_libs_common/file_utils_flac.c b/src/test_libs_common/file_utils_flac.c index 4df6a5ff..3cc8c308 100644 --- a/src/test_libs_common/file_utils_flac.c +++ b/src/test_libs_common/file_utils_flac.c @@ -1,6 +1,6 @@ /* test_libFLAC - Unit tester for libFLAC * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/test_libs_common/metadata_utils.c b/src/test_libs_common/metadata_utils.c index f0d77a1e..929ca639 100644 --- a/src/test_libs_common/metadata_utils.c +++ b/src/test_libs_common/metadata_utils.c @@ -1,6 +1,6 @@ /* test_libFLAC - Unit tester for libFLAC * Copyright (C) 2002-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/test_seeking/Makefile.am b/src/test_seeking/Makefile.am index d0ceca7b..9c9b8da8 100644 --- a/src/test_seeking/Makefile.am +++ b/src/test_seeking/Makefile.am @@ -1,6 +1,6 @@ # test_seeking - Seeking tester for libFLAC # Copyright (C) 2004-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License diff --git a/src/test_seeking/main.c b/src/test_seeking/main.c index be50cedd..16ab9f40 100644 --- a/src/test_seeking/main.c +++ b/src/test_seeking/main.c @@ -1,6 +1,6 @@ /* test_seeking - Seeking tester for libFLAC * Copyright (C) 2004-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/test_streams/Makefile.am b/src/test_streams/Makefile.am index 5dc4a630..9aa4b025 100644 --- a/src/test_streams/Makefile.am +++ b/src/test_streams/Makefile.am @@ -1,6 +1,6 @@ # test_streams - Simple test pattern generator # Copyright (C) 2000-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License diff --git a/src/test_streams/main.c b/src/test_streams/main.c index 886b0249..466bf8ef 100644 --- a/src/test_streams/main.c +++ b/src/test_streams/main.c @@ -1,6 +1,6 @@ /* test_streams - Simple test pattern generator * Copyright (C) 2000-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/utils/Makefile.am b/src/utils/Makefile.am index d609529a..5207b13c 100644 --- a/src/utils/Makefile.am +++ b/src/utils/Makefile.am @@ -1,6 +1,6 @@ # FLAC - Free Lossless Audio Codec # Copyright (C) 2001-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This file is part the FLAC project. FLAC is comprised of several # components distributed under different licenses. The codec libraries diff --git a/src/utils/flacdiff/Makefile.am b/src/utils/flacdiff/Makefile.am index 2186bff5..b181d980 100644 --- a/src/utils/flacdiff/Makefile.am +++ b/src/utils/flacdiff/Makefile.am @@ -1,6 +1,6 @@ # flacdiff - Displays where two FLAC streams differ # Copyright (C) 2007-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License diff --git a/src/utils/flacdiff/main.cpp b/src/utils/flacdiff/main.cpp index 90322a13..358fe047 100644 --- a/src/utils/flacdiff/main.cpp +++ b/src/utils/flacdiff/main.cpp @@ -1,6 +1,6 @@ /* flacdiff - Displays where two FLAC streams differ * Copyright (C) 2007-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/src/utils/flactimer/Makefile.am b/src/utils/flactimer/Makefile.am index cd0de169..07378630 100644 --- a/src/utils/flactimer/Makefile.am +++ b/src/utils/flactimer/Makefile.am @@ -1,6 +1,6 @@ # flactimer - Runs a command and prints timing information # Copyright (C) 2007-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License diff --git a/src/utils/flactimer/main.cpp b/src/utils/flactimer/main.cpp index dbce469e..120a37ff 100644 --- a/src/utils/flactimer/main.cpp +++ b/src/utils/flactimer/main.cpp @@ -1,6 +1,6 @@ /* flactimer - Runs a command and prints timing information * Copyright (C) 2007-2009 Josh Coalson - * Copyright (C) 2011-2022 Xiph.Org Foundation + * Copyright (C) 2011-2023 Xiph.Org Foundation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/test/Makefile.am b/test/Makefile.am index fb9c430a..ce2aca61 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,6 +1,6 @@ # FLAC - Free Lossless Audio Codec # Copyright (C) 2001-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This file is part the FLAC project. FLAC is comprised of several # components distributed under different licenses. The codec libraries diff --git a/test/common.sh.in b/test/common.sh.in index b05c244e..b958f30e 100644 --- a/test/common.sh.in +++ b/test/common.sh.in @@ -1,6 +1,6 @@ # FLAC - Free Lossless Audio Codec # Copyright (C) 2001-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This file is part the FLAC project. FLAC is comprised of several # components distributed under different licenses. The codec libraries diff --git a/test/cuesheets/Makefile.am b/test/cuesheets/Makefile.am index 959fd0cc..8db5c5fe 100644 --- a/test/cuesheets/Makefile.am +++ b/test/cuesheets/Makefile.am @@ -1,6 +1,6 @@ # FLAC - Free Lossless Audio Codec # Copyright (C) 2001-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This file is part the FLAC project. FLAC is comprised of several # components distributed under different licenses. The codec libraries diff --git a/test/flac-to-flac-metadata-test-files/Makefile.am b/test/flac-to-flac-metadata-test-files/Makefile.am index 254ece8e..d76843d1 100644 --- a/test/flac-to-flac-metadata-test-files/Makefile.am +++ b/test/flac-to-flac-metadata-test-files/Makefile.am @@ -1,6 +1,6 @@ # FLAC - Free Lossless Audio Codec # Copyright (C) 2006-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This file is part the FLAC project. FLAC is comprised of several # components distributed under different licenses. The codec libraries diff --git a/test/foreign-metadata-test-files/Makefile.am b/test/foreign-metadata-test-files/Makefile.am index 3cca7a96..bdb2ed2d 100644 --- a/test/foreign-metadata-test-files/Makefile.am +++ b/test/foreign-metadata-test-files/Makefile.am @@ -1,6 +1,6 @@ # FLAC - Free Lossless Audio Codec # Copyright (C) 2006-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This file is part the FLAC project. FLAC is comprised of several # components distributed under different licenses. The codec libraries diff --git a/test/generate_streams.sh b/test/generate_streams.sh index 62887c01..29e32dcb 100755 --- a/test/generate_streams.sh +++ b/test/generate_streams.sh @@ -2,7 +2,7 @@ # FLAC - Free Lossless Audio Codec # Copyright (C) 2001-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This file is part the FLAC project. FLAC is comprised of several # components distributed under different licenses. The codec libraries diff --git a/test/metaflac-test-files/Makefile.am b/test/metaflac-test-files/Makefile.am index 675e3b56..6f089610 100644 --- a/test/metaflac-test-files/Makefile.am +++ b/test/metaflac-test-files/Makefile.am @@ -1,6 +1,6 @@ # FLAC - Free Lossless Audio Codec # Copyright (C) 2006-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This file is part the FLAC project. FLAC is comprised of several # components distributed under different licenses. The codec libraries diff --git a/test/pictures/Makefile.am b/test/pictures/Makefile.am index 4cc3e093..a1bf9e71 100644 --- a/test/pictures/Makefile.am +++ b/test/pictures/Makefile.am @@ -1,6 +1,6 @@ # FLAC - Free Lossless Audio Codec # Copyright (C) 2006-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This file is part the FLAC project. FLAC is comprised of several # components distributed under different licenses. The codec libraries diff --git a/test/test_compression.sh b/test/test_compression.sh index 3972d147..60c23993 100755 --- a/test/test_compression.sh +++ b/test/test_compression.sh @@ -1,7 +1,7 @@ #!/bin/sh -e # FLAC - Free Lossless Audio Codec -# Copyright (C) 2012-2022 Xiph.Org Foundation +# Copyright (C) 2012-2023 Xiph.Org Foundation # # This file is part the FLAC project. FLAC is comprised of several # components distributed under different licenses. The codec libraries diff --git a/test/test_flac.sh b/test/test_flac.sh index cfe51c0c..df2d10e4 100755 --- a/test/test_flac.sh +++ b/test/test_flac.sh @@ -2,7 +2,7 @@ # FLAC - Free Lossless Audio Codec # Copyright (C) 2001-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This file is part the FLAC project. FLAC is comprised of several # components distributed under different licenses. The codec libraries diff --git a/test/test_grabbag.sh b/test/test_grabbag.sh index b5c6cb62..6f2aca12 100755 --- a/test/test_grabbag.sh +++ b/test/test_grabbag.sh @@ -2,7 +2,7 @@ # FLAC - Free Lossless Audio Codec # Copyright (C) 2001-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This file is part the FLAC project. FLAC is comprised of several # components distributed under different licenses. The codec libraries diff --git a/test/test_libFLAC++.sh b/test/test_libFLAC++.sh index 9ae128e3..089ec165 100755 --- a/test/test_libFLAC++.sh +++ b/test/test_libFLAC++.sh @@ -2,7 +2,7 @@ # FLAC - Free Lossless Audio Codec # Copyright (C) 2002-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This file is part the FLAC project. FLAC is comprised of several # components distributed under different licenses. The codec libraries diff --git a/test/test_libFLAC.sh b/test/test_libFLAC.sh index edef8fd2..a3a1f0e5 100755 --- a/test/test_libFLAC.sh +++ b/test/test_libFLAC.sh @@ -2,7 +2,7 @@ # FLAC - Free Lossless Audio Codec # Copyright (C) 2001-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This file is part the FLAC project. FLAC is comprised of several # components distributed under different licenses. The codec libraries diff --git a/test/test_metaflac.sh b/test/test_metaflac.sh index 42e38eb1..b2dbee07 100755 --- a/test/test_metaflac.sh +++ b/test/test_metaflac.sh @@ -2,7 +2,7 @@ # FLAC - Free Lossless Audio Codec # Copyright (C) 2002-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This file is part the FLAC project. FLAC is comprised of several # components distributed under different licenses. The codec libraries diff --git a/test/test_replaygain.sh b/test/test_replaygain.sh index 02464541..69ed9930 100755 --- a/test/test_replaygain.sh +++ b/test/test_replaygain.sh @@ -2,7 +2,7 @@ # FLAC - Free Lossless Audio Codec # Copyright (C) 2002-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This file is part the FLAC project. FLAC is comprised of several # components distributed under different licenses. The codec libraries diff --git a/test/test_seeking.sh b/test/test_seeking.sh index 21a1fe22..a00e7d1c 100755 --- a/test/test_seeking.sh +++ b/test/test_seeking.sh @@ -2,7 +2,7 @@ # FLAC - Free Lossless Audio Codec # Copyright (C) 2004-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This file is part the FLAC project. FLAC is comprised of several # components distributed under different licenses. The codec libraries diff --git a/test/test_streams.sh b/test/test_streams.sh index 09e86ad8..22dd747d 100755 --- a/test/test_streams.sh +++ b/test/test_streams.sh @@ -2,7 +2,7 @@ # FLAC - Free Lossless Audio Codec # Copyright (C) 2001-2009 Josh Coalson -# Copyright (C) 2011-2022 Xiph.Org Foundation +# Copyright (C) 2011-2023 Xiph.Org Foundation # # This file is part the FLAC project. FLAC is comprised of several # components distributed under different licenses. The codec libraries -- cgit v1.2.3 From 4f9be8620bac082d5810c354c83a072491428b18 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Thu, 15 Jun 2023 19:46:38 +0200 Subject: Add github action to check against flac test files --- .github/workflows/distcheck.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/distcheck.yml b/.github/workflows/distcheck.yml index 9694dbe0..d4802c74 100644 --- a/.github/workflows/distcheck.yml +++ b/.github/workflows/distcheck.yml @@ -13,6 +13,11 @@ jobs: steps: - uses: actions/checkout@v3 + - uses: actions/checkout@v3 + with: + repository: ietf-wg-cellar/flac-test-files + path: ./test-files + - name: Install Linux dependencies run: | sudo apt-get update @@ -34,6 +39,9 @@ jobs: abi-compliance-checker -l flac -old test/abi/abi-libFLAC-1.4.0.dump -new test/abi/abi-descriptor-libFLAC-1.4.0.xml abi-compliance-checker -l flac++ -old test/abi/abi-libFLAC++-1.4.0.dump -new test/abi/abi-descriptor-libFLAC++-1.4.0.xml + - name: Check with flac test files + run: ./src/flac/flac -t test-files/subset/*.flac test-files/uncommon/0[15-9]*.flac + - name: Upload ABI compliance reports uses: actions/upload-artifact@v3 with: -- cgit v1.2.3 From d80e574451da8a515afb55d113c731344a667e55 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Fri, 16 Jun 2023 06:46:57 +0200 Subject: Explain use of errno with callbacks --- include/FLAC/callback.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/FLAC/callback.h b/include/FLAC/callback.h index a1c88259..4babcd32 100644 --- a/include/FLAC/callback.h +++ b/include/FLAC/callback.h @@ -90,7 +90,9 @@ typedef void* FLAC__IOHandle; /** Signature for the read callback. * The signature and semantics match POSIX fread() implementations - * and can generally be used interchangeably. + * and can generally be used interchangeably. Note that the global + * variable errno from errno.h is read by some libFLAC functions to + * detect read errors. * * \param ptr The address of the read buffer. * \param size The size of the records to be read. @@ -166,6 +168,9 @@ typedef int (*FLAC__IOCallback_Close) (FLAC__IOHandle handle); * * If the seek requirement for an interface is optional, you can signify that * a data source is not seekable by setting the \a seek field to \c NULL. + * + * See the detailed documentation for callbacks in the + * \link flac_callbacks callbacks \endlink module. */ typedef struct { FLAC__IOCallback_Read read; /**< See FLAC__IOCallbacks */ -- cgit v1.2.3 From 08f8af084593fc5667cadbb1883b6e5004908917 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Sun, 18 Jun 2023 20:32:27 +0200 Subject: Improve on "Check for got_stream_info instead of samplerate being 0" This improves on commit 6db29d1. It turns that commit broke some parsing, this fixes it --- .github/workflows/distcheck.yml | 2 +- src/flac/decode.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/distcheck.yml b/.github/workflows/distcheck.yml index d4802c74..3bafb225 100644 --- a/.github/workflows/distcheck.yml +++ b/.github/workflows/distcheck.yml @@ -40,7 +40,7 @@ jobs: abi-compliance-checker -l flac++ -old test/abi/abi-libFLAC++-1.4.0.dump -new test/abi/abi-descriptor-libFLAC++-1.4.0.xml - name: Check with flac test files - run: ./src/flac/flac -t test-files/subset/*.flac test-files/uncommon/0[15-9]*.flac + run: ./src/flac/flac -t test-files/subset/*.flac test-files/uncommon/0[5-9]*.flac test-files/uncommon/10*.flac - name: Upload ABI compliance reports uses: actions/upload-artifact@v3 diff --git a/src/flac/decode.c b/src/flac/decode.c index bc9c106c..90f7a6c8 100644 --- a/src/flac/decode.c +++ b/src/flac/decode.c @@ -242,7 +242,7 @@ FLAC__bool DecoderSession_construct(DecoderSession *d, FLAC__bool is_ogg, FLAC__ d->has_md5sum = false; d->bps = 0; d->channels = 0; - d->sample_rate = 0; + d->sample_rate = UINT32_MAX; d->channel_mask = 0; d->decode_position = 0; @@ -1172,7 +1172,7 @@ FLAC__StreamDecoderWriteStatus write_callback(const FLAC__StreamDecoder *decoder } /* sanity-check the sample rate */ - if(!decoder_session->got_stream_info) { + if(decoder_session->sample_rate < UINT32_MAX) { if(frame->header.sample_rate != decoder_session->sample_rate) { if(decoder_session->got_stream_info) flac__utils_printf(stderr, 1, "%s: ERROR, sample rate is %u in frame but %u in STREAMINFO\n", decoder_session->inbasefilename, frame->header.sample_rate, decoder_session->sample_rate); @@ -1183,6 +1183,8 @@ FLAC__StreamDecoderWriteStatus write_callback(const FLAC__StreamDecoder *decoder } } else { + /* must not have gotten STREAMINFO, save the sample rate from the frame header */ + FLAC__ASSERT(!decoder_session->got_stream_info); decoder_session->sample_rate = frame->header.sample_rate; } -- cgit v1.2.3 From c7fc1768e8026f1da84dfefdb5e18db220516392 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Wed, 21 Jun 2023 17:09:24 +0200 Subject: Fix library version numbers/sonames --- .github/workflows/distcheck.yml | 4 ++-- doc/release_checklist.md | 3 ++- src/libFLAC++/CMakeLists.txt | 2 +- src/libFLAC++/Makefile.am | 2 +- src/libFLAC/CMakeLists.txt | 2 +- src/libFLAC/Makefile.am | 2 +- test/abi/abi-descriptor-libFLAC++-1.4.0.xml | 11 ----------- test/abi/abi-descriptor-libFLAC++-1.4.3.xml | 11 +++++++++++ test/abi/abi-descriptor-libFLAC-1.4.0.xml | 11 ----------- test/abi/abi-descriptor-libFLAC-1.4.3.xml | 11 +++++++++++ 10 files changed, 30 insertions(+), 29 deletions(-) delete mode 100644 test/abi/abi-descriptor-libFLAC++-1.4.0.xml create mode 100644 test/abi/abi-descriptor-libFLAC++-1.4.3.xml delete mode 100644 test/abi/abi-descriptor-libFLAC-1.4.0.xml create mode 100644 test/abi/abi-descriptor-libFLAC-1.4.3.xml diff --git a/.github/workflows/distcheck.yml b/.github/workflows/distcheck.yml index 3bafb225..90daba2d 100644 --- a/.github/workflows/distcheck.yml +++ b/.github/workflows/distcheck.yml @@ -36,8 +36,8 @@ jobs: make unxz --keep test/abi/abi-libFLAC-1.4.0.dump.xz unxz --keep test/abi/abi-libFLAC++-1.4.0.dump.xz - abi-compliance-checker -l flac -old test/abi/abi-libFLAC-1.4.0.dump -new test/abi/abi-descriptor-libFLAC-1.4.0.xml - abi-compliance-checker -l flac++ -old test/abi/abi-libFLAC++-1.4.0.dump -new test/abi/abi-descriptor-libFLAC++-1.4.0.xml + abi-compliance-checker -l flac -old test/abi/abi-libFLAC-1.4.0.dump -new test/abi/abi-descriptor-libFLAC-1.4.3.xml + abi-compliance-checker -l flac++ -old test/abi/abi-libFLAC++-1.4.0.dump -new test/abi/abi-descriptor-libFLAC++-1.4.3.xml - name: Check with flac test files run: ./src/flac/flac -t test-files/subset/*.flac test-files/uncommon/0[5-9]*.flac test-files/uncommon/10*.flac diff --git a/doc/release_checklist.md b/doc/release_checklist.md index ca826def..3a5a59d7 100644 --- a/doc/release_checklist.md +++ b/doc/release_checklist.md @@ -11,7 +11,8 @@ 1. Update changelog 1. Check copyright year and update if applicable 1. Check libFLAC and libFLAC++ for interface changes and update - version numbers in include/FLAC/export.h, include/FLAC++/export.h + version numbers in include/FLAC/export.h, include/FLAC++/export.h, + src/libFLAC/Makefile.am, src/libFLAC++/Makefile.am, src/libFLAC/CMakeLists.txt and src/libFLAC++/CMakeLists.txt 1. Prepare and check release tarball by running `git clean -ffxd && ./autogen.sh && ./configure && make distcheck` diff --git a/src/libFLAC++/CMakeLists.txt b/src/libFLAC++/CMakeLists.txt index 51fe4c44..3be43ba1 100644 --- a/src/libFLAC++/CMakeLists.txt +++ b/src/libFLAC++/CMakeLists.txt @@ -16,7 +16,7 @@ target_include_directories(FLAC++ INTERFACE target_link_libraries(FLAC++ PUBLIC FLAC) if(BUILD_SHARED_LIBS) set_target_properties(FLAC++ PROPERTIES - VERSION 10.1.0 + VERSION 10.0.1 SOVERSION 10) if(NOT WIN32) set_target_properties(FLAC++ PROPERTIES CXX_VISIBILITY_PRESET hidden) diff --git a/src/libFLAC++/Makefile.am b/src/libFLAC++/Makefile.am index 692aeaac..0b2853b2 100644 --- a/src/libFLAC++/Makefile.am +++ b/src/libFLAC++/Makefile.am @@ -57,7 +57,7 @@ endif endif # see 'http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning' for numbering convention -libFLAC___la_LDFLAGS = $(AM_LDFLAGS) -no-undefined -version-info 10:0:0 $(windows_resource_link) +libFLAC___la_LDFLAGS = $(AM_LDFLAGS) -no-undefined -version-info 10:1:0 $(windows_resource_link) libFLAC___la_LIBADD = ../libFLAC/libFLAC.la libFLAC___la_SOURCES = $(libFLAC___sources) diff --git a/src/libFLAC/CMakeLists.txt b/src/libFLAC/CMakeLists.txt index 5e746277..cf7368f6 100644 --- a/src/libFLAC/CMakeLists.txt +++ b/src/libFLAC/CMakeLists.txt @@ -91,7 +91,7 @@ if(TARGET Ogg::ogg) endif() if(BUILD_SHARED_LIBS) set_target_properties(FLAC PROPERTIES - VERSION 13.0.0 + VERSION 12.1.0 SOVERSION 12) if(NOT WIN32) set_target_properties(FLAC PROPERTIES C_VISIBILITY_PRESET hidden) diff --git a/src/libFLAC/Makefile.am b/src/libFLAC/Makefile.am index 1f03f038..618939df 100644 --- a/src/libFLAC/Makefile.am +++ b/src/libFLAC/Makefile.am @@ -79,7 +79,7 @@ extra_ogg_sources = \ endif # see 'http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning' for numbering convention -libFLAC_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined -version-info 12:0:0 $(windows_resource_link) +libFLAC_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined -version-info 13:0:1 $(windows_resource_link) libFLAC_sources = \ bitmath.c \ diff --git a/test/abi/abi-descriptor-libFLAC++-1.4.0.xml b/test/abi/abi-descriptor-libFLAC++-1.4.0.xml deleted file mode 100644 index 4d19b282..00000000 --- a/test/abi/abi-descriptor-libFLAC++-1.4.0.xml +++ /dev/null @@ -1,11 +0,0 @@ - - 1.4.0 - - - - include/FLAC++/all.h - - - - src/libFLAC++/.libs/libFLAC++.so.10.0.0 - diff --git a/test/abi/abi-descriptor-libFLAC++-1.4.3.xml b/test/abi/abi-descriptor-libFLAC++-1.4.3.xml new file mode 100644 index 00000000..18d6ccdd --- /dev/null +++ b/test/abi/abi-descriptor-libFLAC++-1.4.3.xml @@ -0,0 +1,11 @@ + + 1.4.3 + + + + include/FLAC++/all.h + + + + src/libFLAC++/.libs/libFLAC++.so.10.0.1 + diff --git a/test/abi/abi-descriptor-libFLAC-1.4.0.xml b/test/abi/abi-descriptor-libFLAC-1.4.0.xml deleted file mode 100644 index 75f9b75a..00000000 --- a/test/abi/abi-descriptor-libFLAC-1.4.0.xml +++ /dev/null @@ -1,11 +0,0 @@ - - 1.4.0 - - - - include/FLAC/all.h - - - - src/libFLAC/.libs/libFLAC.so.12.0.0 - diff --git a/test/abi/abi-descriptor-libFLAC-1.4.3.xml b/test/abi/abi-descriptor-libFLAC-1.4.3.xml new file mode 100644 index 00000000..1b083862 --- /dev/null +++ b/test/abi/abi-descriptor-libFLAC-1.4.3.xml @@ -0,0 +1,11 @@ + + 1.4.3 + + + + include/FLAC/all.h + + + + src/libFLAC/.libs/libFLAC.so.12.1.0 + -- cgit v1.2.3 From 28e4f0528c76b296c561e922ba67d43751990599 Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Fri, 23 Jun 2023 09:17:08 +0200 Subject: Release FLAC 1.4.3 --- CHANGELOG.md | 2 +- CMakeLists.txt | 2 +- configure.ac | 2 +- doc/Doxyfile.in | 2 +- man/flac.md | 2 +- man/metaflac.md | 2 +- src/libFLAC/format.c | 2 +- test/Makefile.am | 3 ++- test/metaflac-test-files/case07-expect.meta | 2 +- 9 files changed, 10 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5dc44a66..71467a5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This changelog is not exhaustive, review [the git commit log](https://github.com/xiph/flac/commits) for an exhaustive list of changes. -## git as of 2023-06-05 +## FLAC 1.4.3 (23-Jun-2023) As there have been additions to the libFLAC interfaces, the libFLAC version number is incremented to 13. The libFLAC++ version number stays at 10. diff --git a/CMakeLists.txt b/CMakeLists.txt index e6a381f9..fb23b7d9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ if(NOT (CMAKE_BUILD_TYPE OR CMAKE_CONFIGURATION_TYPES OR DEFINED ENV{CFLAGS} OR set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo") endif() -project(FLAC VERSION 1.4.2) # HOMEPAGE_URL "https://www.xiph.org/flac/") +project(FLAC VERSION 1.4.3) # HOMEPAGE_URL "https://www.xiph.org/flac/") list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") diff --git a/configure.ac b/configure.ac index ac69e5af..418677c7 100644 --- a/configure.ac +++ b/configure.ac @@ -20,7 +20,7 @@ # instead of FLAC__ since autoconf triggers off 'AC_' in strings AC_PREREQ(2.60) -AC_INIT([flac],[1.4.2],[flac-dev@xiph.org],[flac],[https://www.xiph.org/flac/]) +AC_INIT([flac],[1.4.3],[flac-dev@xiph.org],[flac],[https://www.xiph.org/flac/]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_SRCDIR([src/flac/main.c]) AC_CONFIG_MACRO_DIR([m4]) diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in index 0b4864c9..8133ea34 100644 --- a/doc/Doxyfile.in +++ b/doc/Doxyfile.in @@ -32,7 +32,7 @@ PROJECT_NAME = FLAC # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 1.4.2 +PROJECT_NUMBER = 1.4.3 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer diff --git a/man/flac.md b/man/flac.md index 58bb8bf4..b51ac698 100644 --- a/man/flac.md +++ b/man/flac.md @@ -1,4 +1,4 @@ -% flac(1) Version 1.4.2 | Free Lossless Audio Codec conversion tool +% flac(1) Version 1.4.3 | Free Lossless Audio Codec conversion tool # NAME diff --git a/man/metaflac.md b/man/metaflac.md index cc50e462..8c049d74 100644 --- a/man/metaflac.md +++ b/man/metaflac.md @@ -1,4 +1,4 @@ -% metaflac(1) Version 1.4.2 | Free Lossless Audio Codec metadata tool +% metaflac(1) Version 1.4.3 | Free Lossless Audio Codec metadata tool # NAME diff --git a/src/libFLAC/format.c b/src/libFLAC/format.c index b83f528f..8bbffbef 100644 --- a/src/libFLAC/format.c +++ b/src/libFLAC/format.c @@ -55,7 +55,7 @@ FLAC_API const char *FLAC__VENDOR_STRING = "reference libFLAC git-" GIT_COMMIT_H #else /* PACKAGE_VERSION should come from configure */ FLAC_API const char *FLAC__VERSION_STRING = PACKAGE_VERSION; -FLAC_API const char *FLAC__VENDOR_STRING = "reference libFLAC " PACKAGE_VERSION " 20221022"; +FLAC_API const char *FLAC__VENDOR_STRING = "reference libFLAC " PACKAGE_VERSION " 20230623"; #endif FLAC_API const FLAC__byte FLAC__STREAM_SYNC_STRING[4] = { 'f','L','a','C' }; diff --git a/test/Makefile.am b/test/Makefile.am index ce2aca61..2d69fea6 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -49,8 +49,9 @@ endif @echo "----------------" EXTRA_DIST = \ - CMakeLists.txt \ + CMakeLists.txt \ cuesheet.ok \ + generate_streams.sh \ metaflac.flac.in \ metaflac.flac.ok \ picture.ok \ diff --git a/test/metaflac-test-files/case07-expect.meta b/test/metaflac-test-files/case07-expect.meta index 2a025bb5..8e9efd12 100644 --- a/test/metaflac-test-files/case07-expect.meta +++ b/test/metaflac-test-files/case07-expect.meta @@ -1,4 +1,4 @@ -reference libFLAC 1.4.2 20221022 +reference libFLAC 1.4.3 20230623 ARTIST=The_artist_formerly_known_as_the_artist... ARTIST=Chuck_Woolery ARTIST=Vern -- cgit v1.2.3