ext/ffmpeg/gstffmpegenc.c: Fix crash on randomly sized input (#169082).

Original commit message from CVS:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_chain_video):
Fix crash on randomly sized input (#169082).
This commit is contained in:
Ronald S. Bultje 2005-03-12 23:59:15 +00:00
parent 64faa1ce43
commit 35bb7be72c
3 changed files with 10 additions and 5 deletions

View file

@ -1,3 +1,8 @@
2005-03-13 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_chain_video):
Fix crash on randomly sized input (#169082).
2005-03-11 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* configure.ac:

2
common

@ -1 +1 @@
Subproject commit b2638c100721f67b280c3b43b21f1ce1c9b5e316
Subproject commit 131c2632127e6f061b5270d8f80651782a4fdd13

View file

@ -459,19 +459,19 @@ gst_ffmpegenc_chain_video (GstPad * pad, GstData * _data)
GstBuffer *inbuf = GST_BUFFER (_data), *outbuf;
GstFFMpegEncClass *oclass =
(GstFFMpegEncClass *) (G_OBJECT_GET_CLASS (ffmpegenc));
gint ret_size = 0;
gint ret_size = 0, frame_size;
/* FIXME: events (discont (flush!) and eos (close down) etc.) */
outbuf = gst_buffer_new_and_alloc (ffmpegenc->buffer_size);
gst_ffmpeg_avpicture_fill ((AVPicture *) ffmpegenc->picture,
frame_size = gst_ffmpeg_avpicture_fill ((AVPicture *) ffmpegenc->picture,
GST_BUFFER_DATA (inbuf),
ffmpegenc->context->pix_fmt,
ffmpegenc->context->width, ffmpegenc->context->height);
g_return_if_fail (frame_size == GST_BUFFER_SIZE (inbuf));
ffmpegenc->picture->pts = GST_BUFFER_TIMESTAMP (inbuf) / 1000;
outbuf = gst_buffer_new_and_alloc (ffmpegenc->buffer_size);
ret_size = avcodec_encode_video (ffmpegenc->context,
GST_BUFFER_DATA (outbuf),
GST_BUFFER_MAXSIZE (outbuf), ffmpegenc->picture);