mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 18:21:04 +00:00
h264parse: don't critical on VUI parameters > 2^31
A guint32 greater than 2^31 would be interpreted as negative by gst_util_uint64_scale_int() and critical. Use the 64-bit integer version of the function instead.
This commit is contained in:
parent
4f60117db9
commit
062ca5e55b
1 changed files with 3 additions and 3 deletions
|
@ -2286,14 +2286,14 @@ gst_h264_parse_get_timestamp (GstH264Parse * h264parse,
|
||||||
/* If upstream timestamp is valid, we respect it and adjust current
|
/* If upstream timestamp is valid, we respect it and adjust current
|
||||||
* reference point */
|
* reference point */
|
||||||
h264parse->ts_trn_nb = upstream -
|
h264parse->ts_trn_nb = upstream -
|
||||||
(GstClockTime) gst_util_uint64_scale_int
|
(GstClockTime) gst_util_uint64_scale
|
||||||
(h264parse->sei_cpb_removal_delay * GST_SECOND,
|
(h264parse->sei_cpb_removal_delay * GST_SECOND,
|
||||||
sps->vui_parameters.num_units_in_tick,
|
sps->vui_parameters.num_units_in_tick,
|
||||||
sps->vui_parameters.time_scale);
|
sps->vui_parameters.time_scale);
|
||||||
} else {
|
} else {
|
||||||
/* If no upstream timestamp is given, we write in new timestamp */
|
/* If no upstream timestamp is given, we write in new timestamp */
|
||||||
upstream = h264parse->dts = h264parse->ts_trn_nb +
|
upstream = h264parse->dts = h264parse->ts_trn_nb +
|
||||||
(GstClockTime) gst_util_uint64_scale_int
|
(GstClockTime) gst_util_uint64_scale
|
||||||
(h264parse->sei_cpb_removal_delay * GST_SECOND,
|
(h264parse->sei_cpb_removal_delay * GST_SECOND,
|
||||||
sps->vui_parameters.num_units_in_tick,
|
sps->vui_parameters.num_units_in_tick,
|
||||||
sps->vui_parameters.time_scale);
|
sps->vui_parameters.time_scale);
|
||||||
|
@ -2304,7 +2304,7 @@ gst_h264_parse_get_timestamp (GstH264Parse * h264parse,
|
||||||
GST_LOG_OBJECT (h264parse, "duration based ts");
|
GST_LOG_OBJECT (h264parse, "duration based ts");
|
||||||
/* naive method: no removal delay specified
|
/* naive method: no removal delay specified
|
||||||
* track upstream timestamp and provide best guess frame duration */
|
* track upstream timestamp and provide best guess frame duration */
|
||||||
dur = gst_util_uint64_scale_int (duration * GST_SECOND,
|
dur = gst_util_uint64_scale (duration * GST_SECOND,
|
||||||
sps->vui_parameters.num_units_in_tick, sps->vui_parameters.time_scale);
|
sps->vui_parameters.num_units_in_tick, sps->vui_parameters.time_scale);
|
||||||
/* sanity check */
|
/* sanity check */
|
||||||
if (dur < GST_MSECOND) {
|
if (dur < GST_MSECOND) {
|
||||||
|
|
Loading…
Reference in a new issue