From 4760d329374cfbe9d37e01fd1a59718629b04d98 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Mon, 5 Oct 2015 19:28:35 +0300 Subject: [PATCH] ffmpeg: fix invalid NULL pointer access Catched on Ubuntu 12.04 with FFMPEG: codec: YES (ver 53.35.0) format: YES (ver 53.21.1) util: YES (ver 51.22.3) swscale: YES (ver 2.1.0) resample: NO gentoo-style: YES --- modules/videoio/src/cap_ffmpeg_impl.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/videoio/src/cap_ffmpeg_impl.hpp b/modules/videoio/src/cap_ffmpeg_impl.hpp index 4f743ec76c..50ac0a4229 100644 --- a/modules/videoio/src/cap_ffmpeg_impl.hpp +++ b/modules/videoio/src/cap_ffmpeg_impl.hpp @@ -1269,7 +1269,8 @@ static AVStream *icv_add_video_stream_FFMPEG(AVFormatContext *oc, c->gop_size = -1; c->qmin = -1; c->bit_rate = 0; - av_opt_set(c->priv_data,"crf","23", 0); + if (c->priv_data) + av_opt_set(c->priv_data,"crf","23", 0); } #endif