GNOME Bugzilla – Bug 305464
gnome apps abort if trying to play a OOo wav file
Last modified: 2005-08-04 12:27:30 UTC
Steps to reproduce: If you select an OOo wav file such as $(prefix)/share/gallery/sounds/untie.wav as a sound events file, when that event occurs, the application will "crash" (it's actually an abort) Stack trace: (backtrace from evolution)
+ Trace 60177
Thread 1 (Thread 1092944640 (LWP 5107))
Other information: the abort() is in gnome-sound.c:gnome_sound_sample_load_wav() for (;;) { if (fread (buf, 1, 4, f) && fread (&len, 4, 1, f)) { #ifdef WORDS_BIGENDIAN SWAP_LONG (len); #endif if ((buf[0] != 'd') || (buf[1] != 'a') || (buf[2] != 't') || (buf[3] != 'a')) fseek (f, len, SEEK_CUR); else { s->data = g_malloc (len); right here ----^ the problem is that 'len' is a massive value the reason for this is because the value read from the file is corrupt (presumably?), as also seen from the error messages printed from esdplay: esdplay /usr/lib/ooo-2.0/share/gallery/sounds/untie.wav Audio File Library: file missing data -- read 95442 frames, should be 1414285638 [error 5] Audio File Library: file missing data -- read 95442 frames, should be 1414285638 [error 5] it should be noted that I don't get this problem with ANY other wav files downloaded from the net (did a google search for new email sound wav files) and also tested against all the wav files included with GNOME (e.g. email.wav)
while the backtrace is against Evolution, I tested the wav file against the sound events picker window and hit the Play button and also got a crash
Created attachment 46884 [details] [review] a possible fix
*** Bug 163728 has been marked as a duplicate of this bug. ***
Commited this to both branches. Thanks Jeff.
*** Bug 160172 has been marked as a duplicate of this bug. ***
*** Bug 170617 has been marked as a duplicate of this bug. ***
the current 2.11 versions seem to fix this crash but no sound is played
Jeff, any idea why it could break sound output?
yea, it's not playing any sound because g_try_malloc() failed and returned NULL which makes the code hit the error case which makes no sound get played. the only solution this this is to incrementally stream sound files to the sound device rather than loading it completely into memory like the way the code works now - unfortunately this is a non-trivial change and I *think* would require API changes...