Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: 'Bug' report / feature request for the 'File Integrity Verifier' extension (Read 568 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

'Bug' report / feature request for the 'File Integrity Verifier' extension

While playing around with ffmpeg and looking for a format to store large uncompressed audio files over 4 GiB, I happened to find a small problem with the RF64 format (a subset of BWF).

It looks like the 'ds64' extension in the header for files over 4 GiB of the RF64 format has not been taken into account yet.?

Currently in use under Windows 10:
Quote
Core (2023-01-13 20:48:54 UTC)
    foobar2000 core 1.6.16
foo_verifier.dll (2022-02-06 21:40:24 UTC)
    File Integrity Verifier 1.4.2

To reproduce:
Code: [Select]
>ffmpeg -f lavfi -i sine -t 50ms -c:a pcm_s16le -rf64 1 -y 50ms.wav

>hexyl -c 0x80 50ms.wav // (original header from ffmpeg output)
Code: [Select]
┌────────┬─────────────────────────┬─────────────────────────┬────────┬────────┐
│00000000│ 52 46 36 34 ff ff ff ff ┊ 57 41 56 45 64 73 36 34 │RF64××××┊WAVEds64│
│00000010│ 1c 00 00 00 a4 11 00 00 ┊ 00 00 00 00 3a 11 00 00 │•⋄⋄⋄ו⋄⋄┊⋄⋄⋄⋄:•⋄⋄│
│00000020│ 00 00 00 00 9d 08 00 00 ┊ 00 00 00 00 00 00 00 00 │⋄⋄⋄⋄ו⋄⋄┊⋄⋄⋄⋄⋄⋄⋄⋄│
│00000030│ 66 6d 74 20 10 00 00 00 ┊ 01 00 01 00 44 ac 00 00 │fmt •⋄⋄⋄┊•⋄•⋄D×⋄⋄│
│00000040│ 88 58 01 00 02 00 10 00 ┊ 4c 49 53 54 1a 00 00 00 │×X•⋄•⋄•⋄┊LIST•⋄⋄⋄│
│00000050│ 49 4e 46 4f 49 53 46 54 ┊ 0d 00 00 00 4c 61 76 66 │INFOISFT┊_⋄⋄⋄Lavf│
│00000060│ 36 30 2e 33 2e 31 30 30 ┊ 00 00 64 61 74 61 ff ff │60.3.100┊⋄⋄data××│
│00000070│ ff ff 00 00 00 01 ff 01 ┊ fd 02 f8 03 ee 04 e0 05 │××⋄⋄⋄•ו┊וווו│
└────────┴─────────────────────────┴─────────────────────────┴────────┴────────┘

>hexyl -c 0x80 50ms-edited.wav // ('RF64'$filesize ... 'data'$datasize)
Code: [Select]
┌────────┬─────────────────────────┬─────────────────────────┬────────┬────────┐
│00000000│ 52 46 36 34 a4 11 00 00 ┊ 57 41 56 45 64 73 36 34 │RF64ו⋄⋄┊WAVEds64│
│00000010│ 1c 00 00 00 a4 11 00 00 ┊ 00 00 00 00 3a 11 00 00 │•⋄⋄⋄ו⋄⋄┊⋄⋄⋄⋄:•⋄⋄│
│00000020│ 00 00 00 00 9d 08 00 00 ┊ 00 00 00 00 00 00 00 00 │⋄⋄⋄⋄ו⋄⋄┊⋄⋄⋄⋄⋄⋄⋄⋄│
│00000030│ 66 6d 74 20 10 00 00 00 ┊ 01 00 01 00 44 ac 00 00 │fmt •⋄⋄⋄┊•⋄•⋄D×⋄⋄│
│00000040│ 88 58 01 00 02 00 10 00 ┊ 4c 49 53 54 1a 00 00 00 │×X•⋄•⋄•⋄┊LIST•⋄⋄⋄│
│00000050│ 49 4e 46 4f 49 53 46 54 ┊ 0d 00 00 00 4c 61 76 66 │INFOISFT┊_⋄⋄⋄Lavf│
│00000060│ 36 30 2e 33 2e 31 30 30 ┊ 00 00 64 61 74 61 3a 11 │60.3.100┊⋄⋄data:•│
│00000070│ 00 00 00 00 00 01 ff 01 ┊ fd 02 f8 03 ee 04 e0 05 │⋄⋄⋄⋄⋄•ו┊וווו│
└────────┴─────────────────────────┴─────────────────────────┴────────┴────────┘

The report of the 'File Integrity Verifier' extension:
(file paths were edited)
Quote
Item: "...\50ms.wav"
MD5: 42F0F8D38589A2DA783DA2D743F40E67
CRC32: A3048DE1
Warning: Indicated RIFF size exceeds actual file size, file appears to be truncated
Warning: Malformed or truncated chunk found at 106 bytes, claimed length 4294967295 bytes, truncated to 4410 bytes

Item: "...\50ms-edited.wav"
MD5: 42F0F8D38589A2DA783DA2D743F40E67
CRC32: A3048DE1
No problems found.


All items decoded successfully.
1 item decoded with minor problems.

List of decodable but suspicious items:
"...\50ms.wav"

I have looked around a bit and found this about the RF64 format:
https://en.wikipedia.org/wiki/RF64

The last and updated recommendation for RF64 (subgroup of BWF), nicely titled:
'Long-form file format for the international exchange of audio programme materials with metadata'
Page #7 (self numbered as 5)
https://www.itu.int/dms_pubrec/itu-r/rec/bs/R-REC-BS.2088-1-201910-I!!PDF-E.pdf
(Thanks to the good output I could then get from the 4294967295 bytes (0xffff ffff) to the -1 as Int.)

and here also in other languages:
https://www.itu.int/rec/R-REC-BS.2088-1-201910-I/en

Sorry, it almost became a short novel. (;

Thank you and best regards.

PS: And of course thanks for the time and the wonderful player foobar2000 with its solid features and all its extensions.

Re: 'Bug' report / feature request for the 'File Integrity Verifier' extension

Reply #1
Here again a small update:

Uhm, not beautiful. It seems that ffmpeg then writes over 4 GiB only a very reduced header.

Unfortunately I had not tested this before, sorry for that.

But the good news is that the test is terminated without warning by the extension.

Quote
Item: "...\elbe.wav"
MD5: 6DC380B07E4662984DB5C2978AC0A32E
CRC32: 0AEA206A
No problems found.

Quote
File name : elbe.wav
File size : 12.1 GB (13 022 402 706 bytes)
Duration : 18:50:25.014 (3 255 600 648 samples)
Sample rate : 48000 Hz
Channels : 2
Bits per sample : 16
Bitrate : 1536 kbps
Codec : PCM
Encoding : lossless

>hexyl -c 0x200 elbe.wav
Code: [Select]
┌────────┬─────────────────────────┬─────────────────────────┬────────┬────────┐
│00000000│ 52 46 36 34 ff ff ff ff ┊ 57 41 56 45 64 73 36 34 │RF64××××┊WAVEds64│
│00000010│ 1c 00 00 00 8a 18 32 08 ┊ 03 00 00 00 20 18 32 08 │•⋄⋄⋄ו2•┊•⋄⋄⋄ •2•│
│00000020│ 03 00 00 00 08 86 0c c2 ┊ 00 00 00 00 00 00 00 00 │•⋄⋄⋄•×_×┊⋄⋄⋄⋄⋄⋄⋄⋄│
│00000030│ 66 6d 74 20 10 00 00 00 ┊ 01 00 02 00 80 bb 00 00 │fmt •⋄⋄⋄┊•⋄•⋄××⋄⋄│
│00000040│ 00 ee 02 00 04 00 10 00 ┊ 4c 49 53 54 1a 00 00 00 │⋄ו⋄•⋄•⋄┊LIST•⋄⋄⋄│
│00000050│ 49 4e 46 4f 49 53 46 54 ┊ 0d 00 00 00 4c 61 76 66 │INFOISFT┊_⋄⋄⋄Lavf│
│00000060│ 36 30 2e 33 2e 31 30 30 ┊ 00 00 64 61 74 61 ff ff │60.3.100┊⋄⋄data××│
│00000070│ ff ff 00 00 00 00 00 00 ┊ 00 00 00 00 00 00 00 00 │××⋄⋄⋄⋄⋄⋄┊⋄⋄⋄⋄⋄⋄⋄⋄│
│00000080│ 00 00 00 00 00 00 00 00 ┊ 00 00 00 00 00 00 00 00 │⋄⋄⋄⋄⋄⋄⋄⋄┊⋄⋄⋄⋄⋄⋄⋄⋄│
│*       │                         ┊                         │        ┊        │
│00000200│                         ┊                         │        ┊        │
└────────┴─────────────────────────┴─────────────────────────┴────────┴────────┘

Attached are the first 256 bytes of the header as rf64-wav-header-of-a-lage-file.bin

I hope I didn't waste too much of your time. ):

With best regards.

Re: 'Bug' report / feature request for the 'File Integrity Verifier' extension

Reply #2
I don't know if the attached files are actually valid BWF/RF64, but WavPack handles them just fine, and WavPack has a habit of doing things right.

fb2k's integrity verifier is not that happy.

Files are 32-channel sine, 10 seconds, got them from
https://www.lynxstudio.com/downloads/aurora-n/sample-wav-file-zip-encoded-1khz-sine-wave-32-channels-44-1khz-bwf/
https://www.lynxstudio.com/downloads/aurora-n/sample-wav-file-zip-encoded-96khz-pcm-24-32-channels-rf64/
and xz'ed them down to virtually nothing.

Re: 'Bug' report / feature request for the 'File Integrity Verifier' extension

Reply #3
Acknowledged, thanks for reporting.
Microsoft Windows: We can't script here, this is bat country.