theoraenc: fix comparison to unset timestamp

Also rejects negative timestamps that aren't GST_CLOCK_TIME_NONE.

Coverity 1139797
This commit is contained in:
Vincent Penquerc'h 2014-04-10 10:45:21 +01:00
parent 55f98974a8
commit e7c261ff31

View file

@ -888,7 +888,8 @@ theora_enc_handle_frame (GstVideoEncoder * benc, GstVideoCodecFrame * frame)
running_time =
gst_segment_to_running_time (&GST_VIDEO_ENCODER_INPUT_SEGMENT (enc),
GST_FORMAT_TIME, timestamp);
g_return_val_if_fail (running_time >= 0 || timestamp < 0, GST_FLOW_ERROR);
g_return_val_if_fail (running_time >= 0 || timestamp == GST_CLOCK_TIME_NONE,
GST_FLOW_ERROR);
GST_OBJECT_LOCK (enc);
if (enc->bitrate_changed) {