ext/vorbis/vorbisenc.c: If we get a zero-sized input buffer, don't pass it to libvorbis, as that marks EOS internally...
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.
This commit is contained in:
parent
d24780a03b
commit
45b6d734ec
@ -1,3 +1,11 @@
|
||||
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):
|
||||
|
@ -1149,6 +1149,12 @@ gst_vorbis_enc_chain (GstPad * pad, GstBuffer * buffer)
|
||||
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));
|
||||
|
Loading…
x
Reference in New Issue
Block a user