On 01/04/15 21:33, Himangi Saraogi wrote:
> ---
> This probably fixes CID 1292519.
>  avconv.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/avconv.c b/avconv.c
> index da9bc93..ab57fb5 100644
> --- a/avconv.c
> +++ b/avconv.c
> @@ -2105,17 +2105,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";
>              }
> 

IIRC by that time the codec->id is already checked to be within the ids
supported by avcodec_descriptor_get, I'm not against this patch since it
helps not propagating mistakes (since I guess somebody could copy that
block w/out having previous checks).

I'll merge it tonight if nobody has other opinions.

lu
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to