mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 09:10:36 +00:00
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
This commit is contained in:
parent
4d89d7116b
commit
8b63a16af0
1 changed files with 8 additions and 9 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue