summaryrefslogtreecommitdiff
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2002-05-27 19:47:57 +0000
committerMichael Niedermayer <michaelni@gmx.at>2002-05-27 19:47:57 +0000
commit33a1f1a3c13d1af2051a46ee347f13a3580ed178 (patch)
tree7abbef55c12900117495ea90ba44524ac6f7fbd1 /ffmpeg.c
parentcd4af68ad54c189205175a6874f81844fa9a0ba2 (diff)
fixing stackoverflow
Originally committed as revision 618 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 103dc0dea1..e93d730032 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -417,10 +417,14 @@ static void do_video_out(AVFormatContext *s,
int n1, n2, nb, i, ret, frame_number, dec_frame_rate;
AVPicture *picture, *picture2, *pict;
AVPicture picture_tmp1, picture_tmp2;
- UINT8 video_buffer[1024*1024];
+ UINT8 *video_buffer;
UINT8 *buf = NULL, *buf1 = NULL;
AVCodecContext *enc, *dec;
+#define VIDEO_BUFFER_SIZE (1024*1024)
+ video_buffer= av_malloc(VIDEO_BUFFER_SIZE);
+ if(!video_buffer) return;
+
enc = &ost->st->codec;
dec = &ist->st->codec;
@@ -501,7 +505,7 @@ static void do_video_out(AVFormatContext *s,
}
ret = avcodec_encode_video(enc,
- video_buffer, sizeof(video_buffer),
+ video_buffer, VIDEO_BUFFER_SIZE,
picture);
//enc->frame_number = enc->real_pict_num;
s->oformat->write_packet(s, ost->index, video_buffer, ret, 0);
@@ -516,6 +520,7 @@ static void do_video_out(AVFormatContext *s,
the_end:
av_free(buf);
av_free(buf1);
+ av_free(video_buffer);
}
static void do_video_stats(AVOutputStream *ost,