You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-09-16 08:36:51 +02:00
avconv: Avoid theoretical NULL dereferences
Bug-Id: CID 1292519 Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
This commit is contained in:
committed by
Luca Barbato
parent
a4d34e218f
commit
aa1a1b2496
9
avconv.c
9
avconv.c
@@ -2106,17 +2106,22 @@ static int transcode_init(void)
|
|||||||
const char *in_codec_name = "?";
|
const char *in_codec_name = "?";
|
||||||
const char *encoder_name = "?";
|
const char *encoder_name = "?";
|
||||||
const char *out_codec_name = "?";
|
const char *out_codec_name = "?";
|
||||||
|
const AVCodecDescriptor *desc;
|
||||||
|
|
||||||
if (in_codec) {
|
if (in_codec) {
|
||||||
decoder_name = in_codec->name;
|
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))
|
if (!strcmp(decoder_name, in_codec_name))
|
||||||
decoder_name = "native";
|
decoder_name = "native";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (out_codec) {
|
if (out_codec) {
|
||||||
encoder_name = out_codec->name;
|
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))
|
if (!strcmp(encoder_name, out_codec_name))
|
||||||
encoder_name = "native";
|
encoder_name = "native";
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user