简体   繁体   中英

Segmentation fault using GstDiscoverer (GStreamer)

I am writing desktop app for windows on C++ using Qt for GUI and GStreamer for audio processing.

In my app I need to monitor several internet aac audio streams if they are online, and listen to available stream that has the most priority. For this task I use GstDiscoverer object from GStreamer, but I have some problems with it.

I check audio streams every 1-2 seconds, so GstDiscoverer is called very often. And every time my app is running, eventually it will crash with segmentation fault error during GstDiscoverer check.

I tried both sync and async methods of calling GstDiscoverer ( gst_discoverer_discover_uri(), gst_discoverer_discover_uri_async() ) , both work the same way.

The crash happens in aac_type_find() function from gsttypefindfunctions.c on line 1122 (second line of code below).

len = ((c.data[offset + 3] & 0x03) << 11) |
       (c.data[offset + 4] << 3) | ((c.data[offset + 5] & 0xe0) >> 5);

Local variables received from debugger during one of crashes: 在此处输入图片说明

As we can see, offset variable is greater than c.size, so c.data[offset] is out of range, I think that's why segmentation fault happens. This happens not regularly. The program can work several hours or ten minutes. But it seems to me that it happens more often if time interval between calls of GstDiscoverer is little. So, there is some probability of crash calling aac_type_find().

I tried GStreamer versions 1.6.1 and latest 1.6.2, the bug exists in both.

Can somebody help me with this problem? Is this Gstreamer bug or maybe I do something wrong?

已在此处报告给GStreamer项目,该崩溃的补丁已合并,并将在后续版本中发布: https : //bugzilla.gnome.org/show_bug.cgi?id=759910

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM