diff -u ffmpeg.orig/ffmpeg.c ffmpeg/ffmpeg.c --- ffmpeg.orig/ffmpeg.c Mon Aug 13 17:24:19 2001 +++ ffmpeg/ffmpeg.c Tue Oct 16 10:23:31 2001 @@ -210,7 +210,7 @@ int frame_rate, sample_rate, channels; int width, height, frame_number, i, pix_fmt = 0; AVOutputStream *ost_table[s->nb_streams], *ost; - UINT8 *picture_in_buf = NULL, *picture_420p = NULL; + UINT8 *picture_in_buf = NULL, *picture_in_buf2=NULL, *picture_420p = NULL; int audio_fifo_size = 0, picture_size = 0; INT64 time_start; @@ -339,6 +339,7 @@ } picture_size = video_handle->packet_size; picture_in_buf = malloc(picture_size); + picture_in_buf2 = malloc(picture_size); if (!picture_in_buf) goto fail; /* allocate a temporary picture if not grabbing in 420P format */ @@ -469,6 +470,7 @@ if (pix_fmt != PIX_FMT_YUV420P) { picture = &picture_tmp1; + avpicture_fill(picture, picture_in_buf2, PIX_FMT_YUV420P, width, height); img_convert(picture, PIX_FMT_YUV420P, picture2, pix_fmt, width, height);