Bug 174819 - [Amarok2-svn] amarokcollectionscanner crash on corrupt wav file
Summary: [Amarok2-svn] amarokcollectionscanner crash on corrupt wav file
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Collections/Local (show other bugs)
Version: 2.0-SVN
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-10 22:04 UTC by Peter van Fessem
Modified: 2009-12-09 11:28 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Possible patch (979 bytes, patch)
2008-11-10 22:05 UTC, Peter van Fessem
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter van Fessem 2008-11-10 22:04:41 UTC
Version:           r882489 (using Devel)
Compiler:          gcc 4.1.2 
OS:                Linux
Installed from:    Compiled sources

The collection scanner crashes on a few (corrupted) .wav files in my collection because header.num_avg_bytes_per_sec is 0. This generates a division-by-zero in the following line in metadata/wav/wavproperties.cpp:

m_length = ntohl(swap32(header.num_data_bytes))/ntohl(swap32(header.num_avg_bytes_per_sec));

I'm attaching a possible workaround. Ideally such failures should be reported to the user, like in amarok 1.4, but afaik there is no way to do this at present.
Comment 1 Peter van Fessem 2008-11-10 22:05:42 UTC
Created attachment 28480 [details]
Possible patch
Comment 2 Mark Kretschmann 2008-11-12 10:49:42 UTC
SVN commit 883131 by markey:

Fixed possible crash with reading wav files. Patch by Peter van Fessem <peter@f-is.eu>.

BUG: 174819

 M  +2 -0      ChangeLog  
 M  +8 -1      src/metadata/wav/wavproperties.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=883131