Bug 486084 - Collection scan failure for tracks with "inf dB" in REPLAYGAIN_TRACK_GAIN tag field
Summary: Collection scan failure for tracks with "inf dB" in REPLAYGAIN_TRACK_GAIN tag...
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Collections/Local (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: kf5
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-24 17:21 UTC by EP
Modified: 2024-05-19 09:32 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
A track with such tag value (5.48 KB, audio/flac)
2024-04-24 17:21 UTC, EP
Details

Note You need to log in before you can comment on or make changes to this bug.
Description EP 2024-04-24 17:21:42 UTC
Created attachment 168877 [details]
A track with such tag value

SUMMARY
Some misbehaving software wrote `inf dB` into the `REPLAYGAIN_TRACK_GAIN` tag field for "silence" tracks which feature on some albums for padding I guess. Amarok's collection scanner doesn't account for that and tries to insert it into the database as is:
```
amarok:     [ERROR__] [MySqlStorage] "MySQLe query failed! (1054) Unknown column 'inf' in 'field list' on INSERT INTO tracks (url,artist,album,genre,composer,year,title,comment,tracknumber,discnumber,bitrate,length,samplerate,filesize,filetype,bpm,createdate,modifydate,albumgain,albumpeakgain,trackgain,trackpeakgain) VALUES (118410,6375,8775,835,5187,159,'Pause Track','',19,2,1,6467,44100,5614,3,NULL,0,1658593849,-2.63,1.62999,inf,-1);"
amarok:     [WARNING] [SqlRegistryP] Insert failed.
```

STEPS TO REPRODUCE
1. Create/add the test file to the collection
2. Scan the collection

OBSERVED RESULT
The scan fails on the test track.

EXPECTED RESULT
I think it should fall back to 0 for out-of-range values to keep the query valid.

SOFTWARE/OS VERSIONS
OS: Manjaro
amarok-git: 2.9.82.r53.g4b4a4fc-1

ADDITIONAL INFORMATION
n/a
Comment 1 Tuomas Nurmi 2024-04-25 12:41:51 UTC
Thank you for report and sample file! I'll try reproducing and fixing this soonish, not sure if before or after 3.0.0 though
Comment 2 Bug Janitor Service 2024-05-17 20:28:26 UTC
A possibly relevant merge request was started @ https://invent.kde.org/multimedia/amarok/-/merge_requests/97
Comment 3 Tuomas Nurmi 2024-05-19 09:32:30 UTC
Git commit 8cd6f9cd018d13ba1b3800a8db3cddc4c70ed649 by Tuomas Nurmi.
Committed on 17/05/2024 at 20:27.
Pushed by nurmi into branch 'master'.

Ignore any infinite values when reading replaygain tags

Apparently QString::toFloat converts them happily to qreals with infinite value.
We don't really want them in database, however. Also edit TestMetaTrack::testReplayGain
to check that inf gain is ignored.

M  +1    -0    ChangeLog
M  +3    -3    shared/MetaReplayGain.cpp
M  +5    -0    tests/core/meta/TestMetaTrack.cpp
M  +-    --    tests/data/audio/album/Track03.ogg

https://invent.kde.org/multimedia/amarok/-/commit/8cd6f9cd018d13ba1b3800a8db3cddc4c70ed649