Menu

#152 ERROR reading foreign metadata

1.3.0
closed
Erik
5
2015-10-03
2014-11-23
No

I'm trying to reduce my Nuendo projects using flac.
I use this command to create a flac file:
flac -8 --keep-foreign-metadata -f -V "Audio 04_01.wav"
but the result is :
ERROR reading foreign metadata: invalid WAVE file: unexpected EOF (010)
When I remove --keep-foreign-metadata switch I get:
Audio 04_01.wav: WARNING: skipping unknown sub-chunk 'bext' (use --keep-foreign-metadata to keep)
Audio 04_01.wav: WARNING: skipping unknown sub-chunk 'Fake' (use --keep-foreign-metadata to keep)

I've no idea what are those sub-chunks but I don't want to lose any metadata.

I really appreciate your help!
Thanks!

Discussion

  • Erik

    Erik - 2014-11-23

    Is it possible to provide a copy of that file?

     
    • Behzad Eslami Tehrani

      You can find a sample file here

      Thank you!

       
    • lvqcl

      lvqcl - 2014-11-25

      I tested this file here -- https://sourceforge.net/p/flac/bugs/419/

      Here's a possible patch that fixes this case:

      diff --git a/src/flac/foreign_metadata.c b/src/flac/foreign_metadata.c
      index 8afe694..2f5b9b2 100644
      --- a/src/flac/foreign_metadata.c
      +++ b/src/flac/foreign_metadata.c
      @@ -198,8 +198,12 @@ static FLAC__bool read_from_wave_(foreign_metadata_t *fm, FILE *f, const char **
          }
          if(!append_block_(fm, offset, 12, error))
              return false;
      -   if(!fm->is_rf64 || unpack32le_(buffer+4) != 0xffffffffu)
      +   if(!fm->is_rf64 || unpack32le_(buffer+4) != 0xffffffffu) {
              eof_offset = (FLAC__off_t)8 + (FLAC__off_t)unpack32le_(buffer+4);
      +       /* for programs that write odd value to the RIFF size field */
      +       if(eof_offset & 1)
      +           eof_offset++;
      +   }
          while(!feof(f)) {
              FLAC__uint32 size;
              if((offset = ftello(f)) < 0) {
      
       
      • Behzad Eslami Tehrani

        Thank you, I really appreciate your efforts.
        Does this patch (correcting eof) make flac.exe to keep unknown meta-data?

         

        Last edit: Behzad Eslami Tehrani 2014-11-26
  • Erik

    Erik - 2015-10-03
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,4 +1,3 @@
    -
     I'm trying to reduce my Nuendo projects using flac.
     I use this command to create a flac file:
     flac -8 --keep-foreign-metadata -f -V "Audio 04_01.wav"
    
    • status: open --> closed
    • assigned_to: Erik
     
  • Erik

    Erik - 2015-10-03

    The patch provided by @lvqcl has been applied to the git sources. I consider this fixed.

     
    • Behzad Eslami Tehrani

      Thank you so much!
      Were can I find the latest version which includes this patch?
      the last modified date of files for download seems to be for 2014-11-28.

       
      • Erik

        Erik - 2015-10-08

        The patch is:

        commit e771e7b6a7e18e8adf3ea60203548379b58cb99a
        Author: Erik de Castro Lopo <erikd@mega-nerd.com>
        Date:   Fri Jul 10 19:20:24 2015 +1000
        
        flac/foreign_metadata: Fix for odd RIFF chunk size
        
        Accept odd values to ckSize of RIFF chunk. FLAC should read these
        but should avoid creating them.
        
        Patch-from: lvqcl <lvqcl.mail@gmail.com>
        Closes: https://sourceforge.net/p/flac/support-requests/152/
        Closes: https://sourceforge.net/p/flac/bugs/419/
        

        Unfortunately that has not been released yet. FLAC is due for a new release.

         

Log in to post a comment.