summaryrefslogtreecommitdiff
path: root/ext/smoothstreaming
diff options
context:
space:
mode:
authorThiago Santos <thiagoss@osg.samsung.com>2014-12-10 15:27:49 -0300
committerThiago Santos <thiagoss@osg.samsung.com>2014-12-10 15:27:49 -0300
commit8b63a16af0fc3e86ff90b213aac2439deaacf5e7 (patch)
tree322e792a4566eadad9bde3cc594d2edbfe730322 /ext/smoothstreaming
parent4d89d7116b5195f70836564b44594bc0dbffda42 (diff)
downloadgstreamer-plugins-bad-8b63a16af0fc3e86ff90b213aac2439deaacf5e7.tar.gz
mssdemux: fix reverse playback fragment tracking
Rework reverse fragment traversing with repetition fields to prevent NULL pointer deref and avoid never advancing a fragment as the variable is unsigned and would always be non-negative. CID #1257627 CID #1257628
Diffstat (limited to 'ext/smoothstreaming')
-rw-r--r--ext/smoothstreaming/gstmssmanifest.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/ext/smoothstreaming/gstmssmanifest.c b/ext/smoothstreaming/gstmssmanifest.c
index 88c700054..2ee0f3129 100644
--- a/ext/smoothstreaming/gstmssmanifest.c
+++ b/ext/smoothstreaming/gstmssmanifest.c
@@ -986,16 +986,15 @@ gst_mss_stream_regress_fragment (GstMssStream * stream)
return GST_FLOW_EOS;
fragment = stream->current_fragment->data;
- stream->fragment_repetition_index--;
- if (stream->fragment_repetition_index >= 0) {
- return GST_FLOW_OK;
+ if (stream->fragment_repetition_index == 0) {
+ stream->current_fragment = g_list_previous (stream->current_fragment);
+ if (stream->current_fragment == NULL)
+ return GST_FLOW_EOS;
+ fragment = stream->current_fragment->data;
+ stream->fragment_repetition_index = fragment->repetitions - 1;
+ } else {
+ stream->fragment_repetition_index--;
}
-
- stream->current_fragment = g_list_previous (stream->current_fragment);
- fragment = stream->current_fragment->data;
- if (stream->current_fragment == NULL)
- return GST_FLOW_EOS;
- stream->fragment_repetition_index = fragment->repetitions - 1;
return GST_FLOW_OK;
}