gst/audioconvert/audioconvert.c: Prevent overflows with big buffer when calculating the size of the intermediate buff...
Original commit message from CVS: * gst/audioconvert/audioconvert.c: (audio_convert_convert): Prevent overflows with big buffer when calculating the size of the intermediate buffer by using gst_util_uint64_scale() instead of plain arithmetics. Fixes bug #552801.
This commit is contained in:
parent
947ecd72c4
commit
c915582c17
@ -1,3 +1,10 @@
|
|||||||
|
2008-10-08 Sebastian Dröge <sebastian.droege@collabora.co.uk>
|
||||||
|
|
||||||
|
* gst/audioconvert/audioconvert.c: (audio_convert_convert):
|
||||||
|
Prevent overflows with big buffer when calculating the size of
|
||||||
|
the intermediate buffer by using gst_util_uint64_scale() instead of
|
||||||
|
plain arithmetics. Fixes bug #552801.
|
||||||
|
|
||||||
2008-10-08 Sebastian Dröge <sebastian.droege@collabora.co.uk>
|
2008-10-08 Sebastian Dröge <sebastian.droege@collabora.co.uk>
|
||||||
|
|
||||||
Patch by: Pavel Zeldin <pzeldin at gmail dot com>
|
Patch by: Pavel Zeldin <pzeldin at gmail dot com>
|
||||||
|
@ -517,9 +517,9 @@ gboolean
|
|||||||
audio_convert_convert (AudioConvertCtx * ctx, gpointer src,
|
audio_convert_convert (AudioConvertCtx * ctx, gpointer src,
|
||||||
gpointer dst, gint samples, gboolean src_writable)
|
gpointer dst, gint samples, gboolean src_writable)
|
||||||
{
|
{
|
||||||
gint insize, outsize, size;
|
guint insize, outsize, size;
|
||||||
gpointer outbuf, tmpbuf;
|
gpointer outbuf, tmpbuf;
|
||||||
gint intemp = 0, outtemp = 0, biggest;
|
guint intemp = 0, outtemp = 0, biggest;
|
||||||
|
|
||||||
g_return_val_if_fail (ctx != NULL, FALSE);
|
g_return_val_if_fail (ctx != NULL, FALSE);
|
||||||
g_return_val_if_fail (src != NULL, FALSE);
|
g_return_val_if_fail (src != NULL, FALSE);
|
||||||
@ -537,9 +537,9 @@ audio_convert_convert (AudioConvertCtx * ctx, gpointer src,
|
|||||||
: sizeof (gint32);
|
: sizeof (gint32);
|
||||||
|
|
||||||
if (!ctx->in_default)
|
if (!ctx->in_default)
|
||||||
intemp = insize * size * 8 / ctx->in.width;
|
intemp = gst_util_uint64_scale (insize, size * 8, ctx->in.width);
|
||||||
if (!ctx->mix_passthrough || !ctx->out_default)
|
if (!ctx->mix_passthrough || !ctx->out_default)
|
||||||
outtemp = outsize * size * 8 / ctx->out.width;
|
outtemp = gst_util_uint64_scale (outsize, size * 8, ctx->out.width);
|
||||||
biggest = MAX (intemp, outtemp);
|
biggest = MAX (intemp, outtemp);
|
||||||
|
|
||||||
/* see if one of the buffers can be used as temp */
|
/* see if one of the buffers can be used as temp */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user