Don't crash if we receive a buffer without caps. Fixes #572413.
jpegenc = GST_JPEGENC (GST_OBJECT_PARENT (pad));
+ if (G_UNLIKELY (jpegenc->width <= 0 || jpegenc->height <= 0))
+ goto not_negotiated;
+
data = GST_BUFFER_DATA (buf);
size = GST_BUFFER_SIZE (buf);
gst_buffer_unref (buf);
return ret;
+
+/* ERRORS */
+not_negotiated:
+ {
+ GST_WARNING_OBJECT (jpegenc, "no input format set (no caps on buffer)");
+ ret = GST_FLOW_NOT_NEGOTIATED;
+ goto done;
+ }
}
static void
filter->line[0] = NULL;
filter->line[1] = NULL;
filter->line[2] = NULL;
+ filter->width = -1;
+ filter->height = -1;
break;
default:
break;