Possible null dereference

This commit is contained in:
Mystro256 2016-12-30 11:42:00 -05:00
parent 7bc7ff57f4
commit ddef88f0c5
1 changed files with 1 additions and 1 deletions

View File

@ -130,7 +130,7 @@ MediaRet MediaRecorder::setup_sound_stream(const char *fname, AVOutputFormat *fm
ctx->codec_id = fmt->audio_codec; ctx->codec_id = fmt->audio_codec;
ctx->codec_type = AVMEDIA_TYPE_AUDIO; ctx->codec_type = AVMEDIA_TYPE_AUDIO;
// Some encoders don't like int16_t (SAMPLE_FMT_S16) // Some encoders don't like int16_t (SAMPLE_FMT_S16)
ctx->sample_fmt = codec->sample_fmts[0]; if(!codec) ctx->sample_fmt = codec->sample_fmts[0];
// This was changed in the initial ffmpeg 3.0 update, // This was changed in the initial ffmpeg 3.0 update,
// but shouldn't (as far as I'm aware) cause problems with older versions // but shouldn't (as far as I'm aware) cause problems with older versions
ctx->bit_rate = 128000; // arbitrary; in case we're generating mp3 ctx->bit_rate = 128000; // arbitrary; in case we're generating mp3