We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I got garbage when encoding from a large raw audio file (> 7 GiB, 2 ch, 16 bit) and I tracked down this issue as a 32bit overflow.
See the output of a test case below: --skip=1845437663 returns the same audio as --skip=0771695839 .
--skip=1845437663
--skip=0771695839
1845437663-0771695839 is 2**30 which is equivalent to 4 GiB of raw audio data when using 32 bit per sample.
1845437663-0771695839 is 2**30
A self-made "FileCutter" written in C++ using long long 64bit aware counters gets what I want from the same large raw audio file.
long long
I have seen this bug in flac-1.3.2-win and flac-1.4.3-win .
flac-1.3.2
flac-1.4.3-win
If this bug cannot be easily fixed then error action should be taken when --skip=<value> is above the limit.
--skip=<value>
G:\Music\Audacity\Joni Mitchell - Travelogue>regina numeric digits 13; a=1845437663-0771695839 ; b=2**30 ; say a b a-b ^Z 1073741824 1073741824 0 G:\Music\Audacity\Joni Mitchell - Travelogue> G:\Music\Audacity\Joni Mitchell - Travelogue>C:\tools\FLAC\flac-1.3.2-win\win64\flac.exe -f -o ".\__7-56-26206_0020961784_3E2A3C48_0015_0001845459713a.BAD.flac" --best --force-raw-format --endian=little --channels=2 --bps=16 --sample-rate=44100 --sign=signed --skip=1845437663 --until=+21017806 ".\Joni Mitchell - Travelogue (5).raw" G:\Music\Audacity\Joni Mitchell - Travelogue>C:\tools\FLAC\flac-1.3.2-win\win64\flac.exe -f -o ".\__7-56-26206_0020961784_3E2A3C48_0015_0001845459713b.BAD.flac" --best --force-raw-format --endian=little --channels=2 --bps=16 --sample-rate=44100 --sign=signed --skip=0771695839 --until=+21017806 ".\Joni Mitchell - Travelogue (5).raw" G:\Music\Audacity\Joni Mitchell - Travelogue>C:\tools\FLAC\flac-1.3.2-win\win64\flac.exe -d -f -o ".\__7-56-26206_0020961784_3E2A3C48_0015_0001845459713a.BAD.raw" --force-raw-format --endian=little --sign=signed ".\__7-56-26206_0020961784_3E2A3C48_0015_0001845459713a.BAD.flac" G:\Music\Audacity\Joni Mitchell - Travelogue>C:\tools\FLAC\flac-1.3.2-win\win64\flac.exe -d -f -o ".\__7-56-26206_0020961784_3E2A3C48_0015_0001845459713b.BAD.raw" --force-raw-format --endian=little --sign=signed ".\__7-56-26206_0020961784_3E2A3C48_0015_0001845459713b.BAD.flac" G:\Music\Audacity\Joni Mitchell - Travelogue>G:\Downloads\flac-1.4.3-win\flac-1.4.3-win\Win64\flac.exe -f -o ".\__7-56-26206_0020961784_3E2A3C48_0015_0001845459713c.BAD.flac" --best --force-raw-format --endian=little --channels=2 --bps=16 --sample-rate=44100 --sign=signed --skip=1845437663 --until=+21017806 ".\Joni Mitchell - Travelogue (5).raw" G:\Music\Audacity\Joni Mitchell - Travelogue>G:\Downloads\flac-1.4.3-win\flac-1.4.3-win\Win64\flac.exe -f -o ".\__7-56-26206_0020961784_3E2A3C48_0015_0001845459713d.BAD.flac" --best --force-raw-format --endian=little --channels=2 --bps=16 --sample-rate=44100 --sign=signed --skip=0771695839 --until=+21017806 ".\Joni Mitchell - Travelogue (5).raw" G:\Music\Audacity\Joni Mitchell - Travelogue>G:\Downloads\flac-1.4.3-win\flac-1.4.3-win\Win64\flac.exe -d -f -o ".\__7-56-26206_0020961784_3E2A3C48_0015_0001845459713c.BAD.raw" --force-raw-format --endian=little --sign=signed ".\__7-56-26206_0020961784_3E2A3C48_0015_0001845459713c.BAD.flac" G:\Music\Audacity\Joni Mitchell - Travelogue>G:\Downloads\flac-1.4.3-win\flac-1.4.3-win\Win64\flac.exe -d -f -o ".\__7-56-26206_0020961784_3E2A3C48_0015_0001845459713d.BAD.raw" --force-raw-format --endian=little --sign=signed ".\__7-56-26206_0020961784_3E2A3C48_0015_0001845459713d.BAD.flac" G:\Music\Audacity\Joni Mitchell - Travelogue>fc /b ".\__7-56-26206_0020961784_3E2A3C48_0015_0001845459713a.BAD.flac" ".\__7-56-26206_0020961784_3E2A3C48_0015_0001845459713b.BAD.flac" | more Comparing files .\__7-56-26206_0020961784_3E2A3C48_0015_0001845459713a.BAD.flac and .\__7-56-26206_0020961784_3E2A3C48_0015_0001845459713B.BAD.FLAC FC: no differences encountered G:\Music\Audacity\Joni Mitchell - Travelogue>fc /b ".\__7-56-26206_0020961784_3E2A3C48_0015_0001845459713a.BAD.raw" ".\__7-56-26206_0020961784_3E2A3C48_0015_0001845459713b.BAD.raw" | more Comparing files .\__7-56-26206_0020961784_3E2A3C48_0015_0001845459713a.BAD.raw and .\__7-56-26206_0020961784_3E2A3C48_0015_0001845459713B.BAD.RAW FC: no differences encountered G:\Music\Audacity\Joni Mitchell - Travelogue>fc /b ".\__7-56-26206_0020961784_3E2A3C48_0015_0001845459713c.BAD.flac" ".\__7-56-26206_0020961784_3E2A3C48_0015_0001845459713d.BAD.flac" | more Comparing files .\__7-56-26206_0020961784_3E2A3C48_0015_0001845459713c.BAD.flac and .\__7-56-26206_0020961784_3E2A3C48_0015_0001845459713D.BAD.FLAC FC: no differences encountered G:\Music\Audacity\Joni Mitchell - Travelogue>fc /b ".\__7-56-26206_0020961784_3E2A3C48_0015_0001845459713c.BAD.raw" ".\__7-56-26206_0020961784_3E2A3C48_0015_0001845459713d.BAD.raw" | more Comparing files .\__7-56-26206_0020961784_3E2A3C48_0015_0001845459713c.BAD.raw and .\__7-56-26206_0020961784_3E2A3C48_0015_0001845459713D.BAD.RAW FC: no differences encountered G:\Music\Audacity\Joni Mitchell - Travelogue>"C:\Program Files\Git\usr\bin\sha256sum.exe" ".\__7-56-26206_0020961784_3E2A3C48_0015_0001845459713a.BAD.flac" ".\__7-56-26206_0020961784_3E2A3C48_0015_0001845459713b.BAD.flac" ".\__7-56-26206_0020961784_3E2A3C48_0015_0001845459713c.BAD.flac" ".\__7-56-26206_0020961784_3E2A3C48_0015_0001845459713d.BAD.flac" ".\__7-56-26206_0020961784_3E2A3C48_0015_0001845459713a.BAD.raw" ".\__7-56-26206_0020961784_3E2A3C48_0015_0001845459713b.BAD.raw" ".\__7-56-26206_0020961784_3E2A3C48_0015_0001845459713c.BAD.raw" ".\__7-56-26206_0020961784_3E2A3C48_0015_0001845459713d.BAD.raw" \80186417600636d67ca3d3979dcbccd8d6504d5df393f27ba85a8949a0efb47c *.\\__7-56-26206_0020961784_3E2A3C48_0015_0001845459713a.BAD.flac \80186417600636d67ca3d3979dcbccd8d6504d5df393f27ba85a8949a0efb47c *.\\__7-56-26206_0020961784_3E2A3C48_0015_0001845459713b.BAD.flac \cf75f3fde3cd60306d9f5ca8b7e362875ac4e475b3ddda7468f326b6110ba7c3 *.\\__7-56-26206_0020961784_3E2A3C48_0015_0001845459713c.BAD.flac \cf75f3fde3cd60306d9f5ca8b7e362875ac4e475b3ddda7468f326b6110ba7c3 *.\\__7-56-26206_0020961784_3E2A3C48_0015_0001845459713d.BAD.flac \5ae99ecfb2ee988bda4e183c49e6a06078af04a45262d759e0e127047182f4ba *.\\__7-56-26206_0020961784_3E2A3C48_0015_0001845459713a.BAD.raw \5ae99ecfb2ee988bda4e183c49e6a06078af04a45262d759e0e127047182f4ba *.\\__7-56-26206_0020961784_3E2A3C48_0015_0001845459713b.BAD.raw \5ae99ecfb2ee988bda4e183c49e6a06078af04a45262d759e0e127047182f4ba *.\\__7-56-26206_0020961784_3E2A3C48_0015_0001845459713c.BAD.raw \5ae99ecfb2ee988bda4e183c49e6a06078af04a45262d759e0e127047182f4ba *.\\__7-56-26206_0020961784_3E2A3C48_0015_0001845459713d.BAD.raw
The text was updated successfully, but these errors were encountered:
I just looked into this, the cause is this line:
flac/src/flac/encode.c
Line 1132 in b573a36
Sorry, something went wrong.
Fix overflow when skipping over raw input (#737)
d34489c
Fixes #655
Successfully merging a pull request may close this issue.
I got garbage when encoding from a large raw audio file (> 7 GiB, 2 ch, 16 bit) and I tracked down this issue as a 32bit overflow.
See the output of a test case below:
--skip=1845437663
returns the same audio as--skip=0771695839
.1845437663-0771695839 is 2**30
which is equivalent to 4 GiB of raw audio data when using 32 bit per sample.A self-made "FileCutter" written in C++ using
long long
64bit aware counters gets what I want from the same large raw audio file.I have seen this bug in
flac-1.3.2
-win andflac-1.4.3-win
.If this bug cannot be easily fixed then error action should be taken when
--skip=<value>
is above the limit.The text was updated successfully, but these errors were encountered: