From 75d5fcb62e2723680598c6095388dfb4f5eaba37 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 30 Jan 2007 11:29:17 +0000 Subject: [PATCH] gst/audioconvert/gstaudioconvert.c: Don't fail on 0 sized buffers. Fixes #396835. Original commit message from CVS: * gst/audioconvert/gstaudioconvert.c: Don't fail on 0 sized buffers. Fixes #396835. --- ChangeLog | 5 +++++ gst/audioconvert/gstaudioconvert.c | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 874dd4e..8fee8b5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-01-30 Wim Taymans + + * gst/audioconvert/gstaudioconvert.c: + Don't fail on 0 sized buffers. Fixes #396835. + 2007-01-29 David Schleef * gst/typefind/gsttypefindfunctions.c: diff --git a/gst/audioconvert/gstaudioconvert.c b/gst/audioconvert/gstaudioconvert.c index 8c59220..ff78b49 100644 --- a/gst/audioconvert/gstaudioconvert.c +++ b/gst/audioconvert/gstaudioconvert.c @@ -411,8 +411,8 @@ set_structure_widths (GstStructure * s, int min, int max) * channels, as the latter conversion is not lossless. * * So, we return, in order (assuming input caps have only one structure; - * is this right?): -* - input caps with a different format (lossless conversions). + * which is enforced by basetransform): + * - input caps with a different format (lossless conversions). * - input caps with a different format (slightly lossy conversions). * - input caps with a different number of channels (very lossy!) */ @@ -654,6 +654,9 @@ gst_audio_convert_transform (GstBaseTransform * base, GstBuffer * inbuf, if (!(res = audio_convert_get_sizes (&this->ctx, samples, &insize, &outsize))) goto error; + if (insize == 0 || outsize == 0) + return GST_FLOW_OK; + /* check in and outsize */ if (GST_BUFFER_SIZE (inbuf) < insize) goto wrong_size; -- 2.7.4