qtdemux: Avoid negative overflow on keyframe search

Do not overflow negatively when searching a previous
"keyframe" on audio streams. Could cause infinite loops
on backwards playback

Fixes #607718
This commit is contained in:
Roland Krikava 2010-01-21 23:17:40 -03:00 committed by Thiago Santos
parent 701c7d4b2a
commit 8a80fdaad1

View file

@ -1932,7 +1932,10 @@ gst_qtdemux_seek_to_previous_keyframe (GstQTDemux * qtdemux)
k_index = gst_qtdemux_find_keyframe (qtdemux, ref_str,
ref_str->from_sample - 1);
} else {
k_index = ref_str->from_sample - 10;
if (ref_str->from_sample >= 10)
k_index = ref_str->from_sample - 10;
else
k_index = 0;
}
/* get current segment for that stream */