av = dec->rem_img_len;
dec->rem_img_len -= av;
- cinfo->src->next_input_byte = gst_adapter_take (dec->adapter, av);
+ g_free (dec->cur_buf);
+ dec->cur_buf = gst_adapter_take (dec->adapter, av);
+
+ cinfo->src->next_input_byte = dec->cur_buf;
cinfo->src->bytes_in_buffer = av;
return TRUE;
jpeg_abort_decompress (&dec->cinfo);
gst_segment_init (&dec->segment, GST_FORMAT_UNDEFINED);
gst_adapter_clear (dec->adapter);
+ g_free (dec->cur_buf);
+ dec->cur_buf = NULL;
dec->parse_offset = 0;
dec->parse_entropy_len = 0;
dec->parse_resync = FALSE;
dec->parse_offset = 0;
dec->parse_entropy_len = 0;
dec->parse_resync = FALSE;
+ dec->cur_buf = NULL;
gst_segment_init (&dec->segment, GST_FORMAT_UNDEFINED);
gst_jpeg_dec_reset_qos (dec);
default:
switch (transition) {
case GST_STATE_CHANGE_PAUSED_TO_READY:
gst_adapter_clear (dec->adapter);
+ g_free (dec->cur_buf);
+ dec->cur_buf = NULL;
gst_jpeg_dec_free_buffers (dec);
break;
default: