ffmpeg: avoid NULL dereference with filters.
authorNicolas George <nicolas.george@normalesup.org>
Wed, 23 May 2012 19:19:16 +0000 (21:19 +0200)
committerNicolas George <nicolas.george@normalesup.org>
Sun, 3 Jun 2012 21:43:57 +0000 (23:43 +0200)
icodec can be NULL if there is no input stream
clearly associated with the output stream.

ffmpeg.c

index 56c961b..b226779 100644 (file)
--- 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;