mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
ffmpeg: Avoid null pointer dereferences
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
80be7daaa8
commit
d768f8f5cf
9
ffmpeg.c
9
ffmpeg.c
@ -3171,17 +3171,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";
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user