mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-05 17:09:48 +00:00
qtdemux: Don't overflow sample index
Don't reduce sample index if it is already at 0. Assigning -1 to a guint32 variable causes unexpected behavior. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5751>
This commit is contained in:
parent
890e5533ee
commit
4356d4262e
1 changed files with 6 additions and 1 deletions
|
@ -5020,7 +5020,12 @@ gst_qtdemux_seek_to_previous_keyframe (GstQTDemux * qtdemux)
|
|||
}
|
||||
|
||||
/* Remember until where we want to go */
|
||||
str->to_sample = str->from_sample - 1;
|
||||
if (str->from_sample == 0) {
|
||||
GST_LOG_OBJECT (qtdemux, "already at sample 0");
|
||||
str->to_sample = 0;
|
||||
} else {
|
||||
str->to_sample = str->from_sample - 1;
|
||||
}
|
||||
/* Define our time position */
|
||||
target_ts =
|
||||
str->samples[k_index].timestamp + str->samples[k_index].pts_offset;
|
||||
|
|
Loading…
Reference in a new issue