[FFmpeg-devel] [PATCH 1/4] ffmpeg: avoid NULL dereference with filters.

Nicolas George nicolas.george at normalesup.org
Thu May 24 00:46:27 CEST 2012


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

Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
---
 ffmpeg.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index 8f3ffb5..79835a2 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -3196,7 +3196,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;
-- 
1.7.10



More information about the ffmpeg-devel mailing list