mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 01:30:38 +00:00
pngenc: ensure setcaps was called before chain function
This is needed to properly error out for e.g. "fakesrc ! pngenc ! fakesink".
This commit is contained in:
parent
7e390c4635
commit
65f9354803
1 changed files with 5 additions and 0 deletions
|
@ -271,6 +271,11 @@ gst_pngenc_chain (GstPad * pad, GstBuffer * buf)
|
|||
|
||||
GST_DEBUG_OBJECT (pngenc, "BEGINNING");
|
||||
|
||||
if (G_UNLIKELY (pngenc->width <= 0 || pngenc->height <= 0)) {
|
||||
ret = GST_FLOW_NOT_NEGOTIATED;
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (G_UNLIKELY (GST_BUFFER_SIZE (buf) < pngenc->height * pngenc->stride)) {
|
||||
gst_buffer_unref (buf);
|
||||
GST_ELEMENT_ERROR (pngenc, STREAM, FORMAT, (NULL),
|
||||
|
|
Loading…
Reference in a new issue