Commit c68683c1 authored by Wim Taymans's avatar Wim Taymans
Browse files

videodecoder: avoid crash when getting duration

Check that we have a valid output_state before attempting to use it to calculate
the duration of a buffer. It is possible that we don't have a state yet, for
example when we are dropping the first buffers.
parent 43e94eea
......@@ -2342,6 +2342,11 @@ gst_video_decoder_get_frame_duration (GstVideoDecoder * decoder,
GstVideoCodecState *state = decoder->priv->output_state;
/* it's possible that we don't have a state yet when we are dropping the
* initial buffers */
if (state == NULL)
if (state->info.fps_d == 0 || state->info.fps_n == 0) {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment