summaryrefslogtreecommitdiffstats
path: root/gst/real/gstrealvideodec.c
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.net>2007-05-16 17:14:43 +0000
committerTim-Philipp Müller <tim@centricular.net>2007-05-16 17:14:43 +0000
commita6ec2ff8d59fb06a7ff323ce2e1dd91d09db25d6 (patch)
treece7f1263fff15b7da1e1ba698f2aa0c17b366ebc /gst/real/gstrealvideodec.c
parenta7c38b8b37ee83b2dc4154d3526edce8a10e4fa9 (diff)
downloadgst-plugins-bad-a6ec2ff8d59fb06a7ff323ce2e1dd91d09db25d6.tar.gz
gst-plugins-bad-a6ec2ff8d59fb06a7ff323ce2e1dd91d09db25d6.tar.bz2
gst-plugins-bad-a6ec2ff8d59fb06a7ff323ce2e1dd91d09db25d6.zip
gst/real/: Don't crash when we get a buffer and our input caps haven't been set yet; also, don't leak all the input b...
Original commit message from CVS: * gst/real/gstrealaudiodec.c: (gst_real_audio_dec_chain), (gst_real_audio_dec_setcaps): * gst/real/gstrealvideodec.c: (gst_real_video_dec_chain): Don't crash when we get a buffer and our input caps haven't been set yet; also, don't leak all the input buffers (realaudiodec only).
Diffstat (limited to 'gst/real/gstrealvideodec.c')
-rw-r--r--gst/real/gstrealvideodec.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gst/real/gstrealvideodec.c b/gst/real/gstrealvideodec.c
index 32b04ea7..5dceccd5 100644
--- a/gst/real/gstrealvideodec.c
+++ b/gst/real/gstrealvideodec.c
@@ -446,6 +446,9 @@ gst_real_video_dec_chain (GstPad * pad, GstBuffer * in)
guint len = GST_BUFFER_SIZE (in);
GstFlowReturn ret;
+ if (G_UNLIKELY (dec->hooks.transform == NULL || dec->hooks.module == NULL))
+ goto not_negotiated;
+
/* Flags */
if (len < 1)
goto not_enough_data;
@@ -472,6 +475,13 @@ not_enough_data:
gst_buffer_unref (in);
return GST_FLOW_ERROR;
}
+not_negotiated:
+ {
+ GST_WARNING_OBJECT (dec, "decoder not open, probably no input caps set "
+ "yet, caps on input buffer: %" GST_PTR_FORMAT, GST_BUFFER_CAPS (in));
+ gst_buffer_unref (in);
+ return GST_FLOW_NOT_NEGOTIATED;
+ }
}
static gboolean