mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-08 13:22:53 +02:00
MacOS X stack overflow? patch by (Sylvain Corré <sylvain dot corre at wanadoo.fr>)
Originally committed as revision 1694 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
57d0375849
commit
d66c7abc93
14
ffmpeg.c
14
ffmpeg.c
@ -335,11 +335,21 @@ static void do_audio_out(AVFormatContext *s,
|
|||||||
unsigned char *buf, int size)
|
unsigned char *buf, int size)
|
||||||
{
|
{
|
||||||
uint8_t *buftmp;
|
uint8_t *buftmp;
|
||||||
uint8_t audio_buf[2*MAX_AUDIO_PACKET_SIZE]; /* XXX: allocate it */
|
static uint8_t *audio_buf = NULL;
|
||||||
uint8_t audio_out[4*MAX_AUDIO_PACKET_SIZE]; /* XXX: allocate it - yep really WMA */
|
static uint8_t *audio_out = NULL;
|
||||||
|
|
||||||
int size_out, frame_bytes, ret;
|
int size_out, frame_bytes, ret;
|
||||||
AVCodecContext *enc;
|
AVCodecContext *enc;
|
||||||
|
|
||||||
|
/* SC: dynamic allocation of buffers */
|
||||||
|
if (!audio_buf)
|
||||||
|
audio_buf = av_malloc(2*MAX_AUDIO_PACKET_SIZE);
|
||||||
|
if (!audio_out)
|
||||||
|
audio_out = av_malloc(4*MAX_AUDIO_PACKET_SIZE);
|
||||||
|
if (!audio_buf || !audio_out)
|
||||||
|
return; /* Should signal an error ! */
|
||||||
|
|
||||||
|
|
||||||
enc = &ost->st->codec;
|
enc = &ost->st->codec;
|
||||||
|
|
||||||
if (ost->audio_resample) {
|
if (ost->audio_resample) {
|
||||||
|
Loading…
Reference in New Issue
Block a user