GNOME Bugzilla – Bug 796578
discoverer: Don't crash when running with -v if channel-mask==0 and >7 channels
Last modified: 2018-07-18 13:28:10 UTC
See commit message
Created attachment 372668 [details] [review] discoverer: Don't crash when running with -v if channel-mask==0 and >7 channels For e.g. 16-channel audio, if the channel mask is 0 (which it usually is), gst_audio_channel_positions_from_mask would get confused, ultimately leading into a crash.
How does the crash looks like? It shouldn't crash in the first place I think.
Done discovering file:///home/vivia/delme.wav Topology: audio: audio/x-wav 0:00:00.944417687 25062 0x5555557c5b80 ERROR audio-channels audio-channels.c:390:gst_audio_channel_positions_from_mask: no channel-mask property given Thread 1 "gst-discoverer-" received signal SIGSEGV, Segmentation fault. 0x0000555555557a3c in format_channel_mask (ainfo=0x5555559e4260 [GstDiscovererAudioInfo]) at gst-discoverer.c:169 169 my_g_string_append_printf (s, 0, "%s%s", value->value_nick, (gdb) print s $1 = (GString *) 0x5555557c3b20 (gdb) print value $2 = (GEnumValue *) 0x0 (gdb)
My first approach was to print "unknown" in that case, but then it looked bad: Channels: 16 (front-left, front-left, unknown, unknown, unknown, unknown, rear-center, front-left, unknown, unknown, unknown, front-left, front-left, front-left, unknown, unknown) Whatever values are there are just default guesses anyway, the channel-mask is 0 so that looked wrong to me. That's why I thought about this approach.
Comment on attachment 372668 [details] [review] discoverer: Don't crash when running with -v if channel-mask==0 and >7 channels Seems fine to me. Unless Thibault has any actual objections, let's get this in
Review of attachment 372668 [details] [review]: Look good then
Review of attachment 372668 [details] [review]: commit effd8920217923ef314f71fe90f41e005d2f92ef (HEAD -> master, dev/master) Author: Vivia Nikolaidou <vivia@ahiru.eu> Date: Wed Jun 13 15:29:46 2018 +0300 discoverer: Don't crash when running with -v if channel-mask==0 and >7 channels For e.g. 16-channel audio, if the channel mask is 0 (which it usually is), gst_audio_channel_positions_from_mask would get confused, ultimately leading into a crash. https://bugzilla.gnome.org/show_bug.cgi?id=796578