#221 -t option returns 0 even after MD5 check failure

closed
5
2006-07-07
2006-05-23
elrond79
No

I noticed that when calling flac with the -t option,
the program will still return a "pass" errorcode 0 even
when the tested flac fails an MD5 check (as well as a
FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC error, as
indicated by my test file). The proper warnings will
appear on the console, but the errorcode is not
correctly set to non-zero.

After a cursory glance at the source code, the problem
would appear to be in the 'DecoderSession_finish_ok'
function within decode.c - here, it checks for MD5
mismatch, and prints an error message if it fails...
but does NOT change the return value. Of course, I'm
not much of a developer, and didn't look at the code
too deeply, so the problem could be elsewhere...

If you want, I can send you the the .flac file I
initially found this problem with (since it also raises
the aforementioned
FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC errors
without an error - as I'm not sure exactly what these
errors signify, I'm not sure if flac was intended to
return a failure errorcode on these or not =P ). I
initially tried to upload it along with this bug
report, but it wouldn't allow it - likely because the
file is too big...

Discussion

  • Josh Coalson

    Josh Coalson - 2006-07-07

    Logged In: YES
    user_id=78173

    I don't see how a sync error cannot cause a non-zero exit
    code; I'll need a file to reproduce that.

    I'll change the MD5 failure into an error and return
    non-zero.

    Josh

     
  • Josh Coalson

    Josh Coalson - 2006-07-07
    • assigned_to: nobody --> jcoalson
    • status: open --> closed
     

Log in to post a comment.