[FFmpeg-cvslog] ffmpeg: avoid NULL dereference with filters.

Nicolas George git at videolan.org
Sun Jun 3 23:59:02 CEST 2012


ffmpeg | branch: master | Nicolas George <nicolas.george at normalesup.org> | Wed May 23 21:19:16 2012 +0200| [48b5bcb3dd42bb0018850f41f7e090418e1b0dfb] | committer: Nicolas George

ffmpeg: avoid NULL dereference with filters.

icodec can be NULL if there is no input stream
clearly associated with the output stream.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=48b5bcb3dd42bb0018850f41f7e090418e1b0dfb
---

 ffmpeg.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index 56c961b..b226779 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -3103,7 +3103,8 @@ static int transcode_init(void)
                     ost->filter->filter->inputs[0]->sample_aspect_ratio;
                 codec->pix_fmt = ost->filter->filter->inputs[0]->format;
 
-                if (codec->width   != icodec->width  ||
+                if (!icodec ||
+                    codec->width   != icodec->width  ||
                     codec->height  != icodec->height ||
                     codec->pix_fmt != icodec->pix_fmt) {
                     codec->bits_per_raw_sample = frame_bits_per_raw_sample;



More information about the ffmpeg-cvslog mailing list