ffmpeg.c:2727: error: Null Dereference
  pointer `codec` last assigned on line 2720 could be null and is dereferenced at line 2727, column 8.

ffmpeg.c:2713:1: start of procedure find_codec_or_die()
2711. }
2712. 
2713. static enum CodecID find_codec_or_die(const char *name, int type, int encoder)
      ^
2714. {
2715.     const char *codec_string = encoder ? "encoder" : "decoder";

ffmpeg.c:2715:32: Condition is true
2713. static enum CodecID find_codec_or_die(const char *name, int type, int encoder)
2714. {
2715.     const char *codec_string = encoder ? "encoder" : "decoder";
                                     ^
2716.     AVCodec *codec;
2717. 

ffmpeg.c:2715:5: 
2713. static enum CodecID find_codec_or_die(const char *name, int type, int encoder)
2714. {
2715.     const char *codec_string = encoder ? "encoder" : "decoder";
          ^
2716.     AVCodec *codec;
2717. 

ffmpeg.c:2718:9: Taking false branch
2716.     AVCodec *codec;
2717. 
2718.     if(!name)
              ^
2719.         return CODEC_ID_NONE;
2720.     codec = encoder ?

ffmpeg.c:2720:13: Condition is true
2718.     if(!name)
2719.         return CODEC_ID_NONE;
2720.     codec = encoder ?
                  ^
2721.         avcodec_find_encoder_by_name(name) :
2722.         avcodec_find_decoder_by_name(name);

ffmpeg.c:2720:5: 
2718.     if(!name)
2719.         return CODEC_ID_NONE;
2720.     codec = encoder ?
          ^
2721.         avcodec_find_encoder_by_name(name) :
2722.         avcodec_find_decoder_by_name(name);

ffmpeg.c:2723:9: Taking true branch
2721.         avcodec_find_encoder_by_name(name) :
2722.         avcodec_find_decoder_by_name(name);
2723.     if(!codec) {
              ^
2724.         av_log(NULL, AV_LOG_ERROR, "Unknown %s '%s'\n", codec_string, name);
2725.         av_exit(1);

ffmpeg.c:2724:9: Skipping av_log(): empty list of specs
2722.         avcodec_find_decoder_by_name(name);
2723.     if(!codec) {
2724.         av_log(NULL, AV_LOG_ERROR, "Unknown %s '%s'\n", codec_string, name);
              ^
2725.         av_exit(1);
2726.     }

ffmpeg.c:2725:9: Skipping av_exit(): empty list of specs
2723.     if(!codec) {
2724.         av_log(NULL, AV_LOG_ERROR, "Unknown %s '%s'\n", codec_string, name);
2725.         av_exit(1);
              ^
2726.     }
2727.     if(codec->type != type) {

ffmpeg.c:2727:8: 
2725.         av_exit(1);
2726.     }
2727.     if(codec->type != type) {
             ^
2728.         av_log(NULL, AV_LOG_ERROR, "Invalid %s type '%s'\n", codec_string, name);
2729.         av_exit(1);

static enum CodecID find_codec_or_die(const char *name, int type, int encoder)
{
    const char *codec_string = encoder ? "encoder" : "decoder";
    AVCodec *codec;
    if(!name)
        return CODEC_ID_NONE;
    codec = encoder ?
        avcodec_find_encoder_by_name(name) :
        avcodec_find_decoder_by_name(name);
    if(!codec) {
        av_log(NULL, AV_LOG_ERROR, "Unknown %s '%s'\n", codec_string, name);
        av_exit(1);
    }
    if(codec->type != type) {
        av_log(NULL, AV_LOG_ERROR, "Invalid %s type '%s'\n", codec_string, name);
        av_exit(1);
    }
    return codec->id;
}
['static enum CodecID find_codec_or_die(const char *name, int type, int encoder)\n{\n    const char *codec_string = encoder ? "encoder" : "decoder";\n    AVCodec *codec;\n    if(!name)\n        return CODEC_ID_NONE;\n    codec = encoder ?\n        avcodec_find_encoder_by_name(name) :\n        avcodec_find_decoder_by_name(name);\n    if(!codec) {\n        av_log(NULL, AV_LOG_ERROR, "Unknown %s \'%s\'\\n", codec_string, name);\n        av_exit(1);\n    }\n    if(codec->type != type) {\n        av_log(NULL, AV_LOG_ERROR, "Invalid %s type \'%s\'\\n", codec_string, name);\n        av_exit(1);\n    }\n    return codec->id;\n}']