gchudov / cuetools.net

CD image processing suite with optimized lossless encoders in C#
http://cue.tools/
Other
480 stars 51 forks source link

Found a file that causes crash of encoder at certain settings #315

Open DarkVoyage opened 6 months ago

DarkVoyage commented 6 months ago

Windows 7/10/11 x64 Video: GTX 1050Ti, GTX 1650 Super

Tested on three very different machines, nothing in common.

I use FLACCL in foobar2000 with these settings: -11 --lax --fast-gpu - -o %d

I converted 1000s files without problems with same settings, but found one file that crashes in the end of encoding with message "an error occurred while finalizing encode". Encoded file is removed automatically. Removed tags from source file - no difference. Tried to encode from WAV - same.

Then I tried to find an exact problematic sector inside a file - this is nearly 80 minute trance mix. Cut it in 40m halves. n1- error, n2 - ok. Cut again to 20m halves. n1 - error, n2 - ok. Cut again. Both are no error. So ended up with 20 minute file that encoding to error with settings above.

Tried to change settings. And it worked with full mix and cuts. So narrowed the problem to --fast-gpu switch. Changing to --slow-gpu removes the issue. I know that --fast-gpu is experimental option, but as I said had no problem with it for years. So maybe you can fix. I can send you the problematic file.

UPD: I narrowed the search for error in the problematic file to some of the next factors:

image

So I understand that the problem is that exact frame at an unlucky position gets into converter and causes error with its content. This frame contains some kind of too loud components at highs. This is some very rare situation that happens once on a blue moon. Just catched it accidentally.

UPD2: Tried to encode without foobar2000 with same settings in cmd. Encoding finishes without errors. But if you verify that FLAC file in foobar2000 it shows: Corrupted FLAC stream; MD5 mismatch.

Comparation to source file shows: Differences found: 8192 values, 18:36.601179 - 18:36.694036, peak: 0.821899 (-1.70 dBFS) at 18:36.673991, 2ch

Actually you can't see what exactly is encoded there (with RX), because this frame is undecodable and broken.

UPD: I will upload file on request, if someone needs.