mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-28 03:00:35 +00:00
x264enc: Check if we have an input state before using it
Flushing might happen before caps were set on the encoder, which would lead to crashes here. Thanks to Matej Knopp for analyzing this. https://bugzilla.gnome.org/show_bug.cgi?id=707414
This commit is contained in:
parent
ae45623450
commit
55037ab411
1 changed files with 8 additions and 1 deletions
|
@ -1169,7 +1169,14 @@ static gboolean
|
|||
gst_x264_enc_init_encoder (GstX264Enc * encoder)
|
||||
{
|
||||
guint pass = 0;
|
||||
GstVideoInfo *info = &encoder->input_state->info;
|
||||
GstVideoInfo *info;
|
||||
|
||||
if (!encoder->input_state) {
|
||||
GST_DEBUG_OBJECT (encoder, "Have no input state yet");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
info = &encoder->input_state->info;
|
||||
|
||||
/* make sure that the encoder is closed */
|
||||
gst_x264_enc_close_encoder (encoder);
|
||||
|
|
Loading…
Reference in a new issue