summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorSebastian Dröge <slomo@circular-chaos.org>2013-09-04 16:32:43 +0200
committerSebastian Dröge <slomo@circular-chaos.org>2013-09-04 16:33:18 +0200
commit55037ab411218786a7625e2d8827ae253f4b4909 (patch)
treedaad60a42af4e529004c6b47dafb7237adc560c3 /ext
parentae45623450e28c8c8bd5017d04605facc27298f3 (diff)
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
Diffstat (limited to 'ext')
-rw-r--r--ext/x264/gstx264enc.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/ext/x264/gstx264enc.c b/ext/x264/gstx264enc.c
index 1be3ddf8..29b4c21c 100644
--- a/ext/x264/gstx264enc.c
+++ b/ext/x264/gstx264enc.c
@@ -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);