After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 751911 - dashdemux: mimeType local variable must be reinitialized at the beginning of loop iteration
dashdemux: mimeType local variable must be reinitialized at the beginning of ...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other All
: Normal normal
: 1.5.90
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-07-03 15:09 UTC by Florin Apostol
Modified: 2015-08-16 13:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (2.03 KB, patch)
2015-07-03 15:11 UTC, Florin Apostol
committed Details | Review

Description Florin Apostol 2015-07-03 15:09:15 UTC
in gst_mpdparser_get_list_and_nb_of_audio_language function, the mimeType variable is used inside a loop. It must be set to NULL at the beginning of each iteration. Otherwise, the value from the previous iteration might influence the decisions of the current iteration.
Comment 1 Florin Apostol 2015-07-03 15:11:14 UTC
Created attachment 306722 [details] [review]
proposed patch
Comment 2 Thiago Sousa Santos 2015-07-03 16:57:16 UTC
Review of attachment 306722 [details] [review]:

::: ext/dash/gstmpdparser.c
@@ +4475,3 @@
       list = g_list_next (list)) {
     adapt_set = (GstAdaptationSetNode *) list->data;
+    if (adapt_set && adapt_set->lang) {

This change doesn't seem related and why are you enforcing having lang set?
Comment 3 Florin Apostol 2015-07-04 09:19:09 UTC
it's a code optimization. If the lang is not set, the loop will not do anything. So we test the lag at the beginning to avoid calling gst_mpdparser_get_lowest_representation and check the mimeType for nothing.
Comment 4 Thiago Sousa Santos 2015-07-05 19:55:54 UTC
commit 5151c42085dacfa2c0f4df07d8e27db1036c91e8
Author: Florin Apostol <florin.apostol@oregan.net>
Date:   Fri Jul 3 16:10:20 2015 +0100

    dashdemux: corrected search for audio languages
    
    Corrected the initialisation of mimeType in
    gst_mpdparser_get_list_and_nb_of_audio_language: the variable is used
    in a loop, so it must be set to NULL at the beginning of each iteration.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=751911