diff options
author | Himangi Saraogi <himangi774@gmail.com> | 2015-04-02 01:03:04 +0530 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2015-04-04 19:32:10 +0200 |
commit | aa1a1b2496cf3ca817e78e27bd0262a50adb91a1 (patch) | |
tree | 33e73d4a5b72cadc18c1c5889e9432156e4b8f6a /avconv.c | |
parent | a4d34e218f548d381e09c483e8dc6ad18a8d571c (diff) | |
download | ffmpeg-aa1a1b2496cf3ca817e78e27bd0262a50adb91a1.tar.gz |
avconv: Avoid theoretical NULL dereferences
Bug-Id: CID 1292519
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'avconv.c')
-rw-r--r-- | avconv.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -2106,17 +2106,22 @@ static int transcode_init(void) const char *in_codec_name = "?"; const char *encoder_name = "?"; const char *out_codec_name = "?"; + const AVCodecDescriptor *desc; if (in_codec) { decoder_name = in_codec->name; - in_codec_name = avcodec_descriptor_get(in_codec->id)->name; + desc = avcodec_descriptor_get(in_codec->id); + if (desc) + in_codec_name = desc->name; if (!strcmp(decoder_name, in_codec_name)) decoder_name = "native"; } if (out_codec) { encoder_name = out_codec->name; - out_codec_name = avcodec_descriptor_get(out_codec->id)->name; + desc = avcodec_descriptor_get(out_codec->id); + if (desc) + out_codec_name = desc->name; if (!strcmp(encoder_name, out_codec_name)) encoder_name = "native"; } |