{
GstFlowReturn ret = GST_FLOW_OK;
GstJpegDec *dec;
- GstBuffer *outbuf;
+ GstBuffer *outbuf = NULL;
guchar *data, *outdata;
guchar *base[3], *last[3];
guint img_len, outsize;
need_more_data:
{
GST_LOG_OBJECT (dec, "we need more data");
+ if (outbuf) {
+ gst_buffer_unref (outbuf);
+ outbuf = NULL;
+ }
ret = GST_FLOW_OK;
goto exit;
}
GST_ELEMENT_ERROR (dec, STREAM, DECODE,
(_("Failed to decode JPEG image")),
("Error #%u: %s", code, dec->jerr.pub.jpeg_message_table[code]));
+ if (outbuf) {
+ gst_buffer_unref (outbuf);
+ outbuf = NULL;
+ }
ret = GST_FLOW_ERROR;
goto done;
}