mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 06:46:38 +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/5743>
This commit is contained in:
parent
269df73f92
commit
7bf646e5ba
1 changed files with 6 additions and 1 deletions
|
@ -5373,7 +5373,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