flac: WARNING cannot check MD5 signature since it was unset in the STREAMINFO

To run integrity checks I use respective functions:

flac --test test.flac
flac --analyze test.flac

these are giving me:

flac 1.3.3-b84ff55
Copyright (C) 2000-2009  Josh Coalson, 2011-2019  Xiph.Org Foundation
flac comes with ABSOLUTELY NO WARRANTY.  This is free software, and you are
welcome to redistribute it under certain conditions.  Type `flac' for details.

test.flac: WARNING, cannot check MD5 signature since it was unset in the STREAMINFO
ok

What does it mean? It’s “ok” (probably the decoding part) but It can not check the MD5 signature? Does this work as integrity check at all!?!?

And I do not have it on all flacs though! I have it now on newly converted wav and also reencoded flacs.

The flac git version acts the same way as the official 1.3.3. version I have on my Ubuntu.

Any hint is a appreciated.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 2
  • Comments: 17 (3 by maintainers)

Most upvoted comments

This warning means the encoder didn’t record a checksum in the stream header.

The ok means the decoder was able to decode all the data, but because the original encoder didn’t record an MD5 sum, it couldn’t compare the decoded data to check that it was bit-identical to the original. This might happen, for example, if the flac was recorded live, so the creating application couldn’t know what the complete audio stream would be.

In other words, the files aren’t corrupt, but have weaker integrity guarantees. Re-encoding is a good way to address the issue.

I presume this was fixed by #227, which was included in release 1.3.4, therefore I’m closing this issue.

It was still an issue on my other platforms.

As outlined at the end of #192 There’s been a patch developed.

It turned out to be gcc related. https://sourceforge.net/p/flac/bugs/478/

I just applied that patch on all my platforms and now all is fine.

--- flac-1.3.3/src/flac/decode.c	2018-08-25 01:56:06.666934412 -0700
+++ flac-1.3.3/src/flac/decode.c	2020-03-05 09:44:42.825560660 -0800
@@ -1306,8 +1306,9 @@
 
 	if(metadata->type == FLAC__METADATA_TYPE_STREAMINFO) {
 		FLAC__uint64 skip, until;
+		FLAC__byte emptyMD5[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
 		decoder_session->got_stream_info = true;
-		decoder_session->has_md5sum = memcmp(metadata->data.stream_info.md5sum, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16);
+		decoder_session->has_md5sum = memcmp(metadata->data.stream_info.md5sum, emptyMD5, 16);
 		decoder_session->bps = metadata->data.stream_info.bits_per_sample;
 		decoder_session->channels = metadata->data.stream_info.channels;
 		decoder_session->sample_rate = metadata->data.stream_info.sample_rate;

Anybody issued a pull request?