[FFmpeg-cvslog] avconv: Avoid theoretical NULL dereferences
Himangi Saraogi
git at videolan.org
Sun Apr 5 01:05:43 CEST 2015
ffmpeg | branch: master | Himangi Saraogi <himangi774 at gmail.com> | Thu Apr 2 01:21:04 2015 +0530| [aa1a1b2496cf3ca817e78e27bd0262a50adb91a1] | committer: Luca Barbato
avconv: Avoid theoretical NULL dereferences
Bug-Id: CID 1292519
Signed-off-by: Luca Barbato <lu_zero at gentoo.org>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=aa1a1b2496cf3ca817e78e27bd0262a50adb91a1
---
avconv.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/avconv.c b/avconv.c
index fc02c05..1ad6e5e 100644
--- a/avconv.c
+++ b/avconv.c
@@ -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";
}
More information about the ffmpeg-cvslog
mailing list