GNOME Bugzilla – Bug 755411
mpdparser: Only check stream->segments for a repeated last segment if we have a static list of segments
Last modified: 2015-09-22 13:04:17 UTC
See commit message
Created attachment 311853 [details] [review] mpdparser: Only check stream->segments for a repeated last segment if we have a static list of segments Otherwise we'll crash, trying to derefence NULL. And if we have no static list of segments, we can't have repeated segments anyway. Regression introduced by cfe2871a5e3c5b1db20470927642b776e055a87a
Review of attachment 311853 [details] [review]: ::: ext/dash/gstmpdparser.c @@ +4755,3 @@ + if (segments_count > 0 && stream->segments + && stream->segment_index + 1 == segments_count) { Shouldn't segments_count be 0 when stream->segments == NULL? Fixing the root cause here seems safer.
(In reply to Thiago Sousa Santos from comment #2) > Review of attachment 311853 [details] [review] [review]: > > ::: ext/dash/gstmpdparser.c > @@ +4755,3 @@ > > + if (segments_count > 0 && stream->segments > + && stream->segment_index + 1 == segments_count) { > > Shouldn't segments_count be 0 when stream->segments == NULL? No, you can still have a finite number of segments... based on a segment template, the segment durations and the duration of the period.
Review of attachment 311853 [details] [review]: ::: ext/dash/gstmpdparser.c @@ +4755,3 @@ + if (segments_count > 0 && stream->segments + && stream->segment_index + 1 == segments_count) { Seems I was wrong, it can be NULL, indeed. Thanks for the fix.
commit a25253130b573c842805439e424eb048c1ef9bbc Author: Sebastian Dröge <sebastian@centricular.com> Date: Tue Sep 22 14:43:44 2015 +0200 mpdparser: Only check stream->segments for a repeated last segment if we have a static list of segments Otherwise we'll crash, trying to derefence NULL. And if we have no static list of segments, we can't have repeated segments anyway. Regression introduced by cfe2871a5e3c5b1db20470927642b776e055a87a https://bugzilla.gnome.org/show_bug.cgi?id=755411