Original commit message from CVS:
* ext/vorbis/vorbisenc.c: (gst_vorbis_enc_chain):
If we get a zero-sized input buffer, don't pass it to libvorbis, as
that marks EOS internally. After that, libvorbis will buffer all
input data, and encode none of it, eventually leading to memory
exhaustion.
+2007-03-20 Michael Smith <msmith@fluendo.com>
+
+ * ext/vorbis/vorbisenc.c: (gst_vorbis_enc_chain):
+ If we get a zero-sized input buffer, don't pass it to libvorbis, as
+ that marks EOS internally. After that, libvorbis will buffer all
+ input data, and encode none of it, eventually leading to memory
+ exhaustion.
+
2007-03-19 Wim Taymans <wim@fluendo.com>
* gst/playback/gstdecodebin.c: (remove_fakesink):
vorbisenc->next_discont = TRUE;
}
+ /* Sending zero samples to libvorbis marks EOS, so we mustn't do that */
+ if (GST_BUFFER_SIZE (buffer) == 0) {
+ gst_buffer_unref (buffer);
+ return GST_FLOW_OK;
+ }
+
/* data to encode */
data = (gfloat *) GST_BUFFER_DATA (buffer);
size = GST_BUFFER_SIZE (buffer) / (vorbisenc->channels * sizeof (float));