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

ffmpeg.c:2960:1: start of procedure find_codec_or_die()
2958. }
2959. 
2960. static enum CodecID find_codec_or_die(const char *name, int type, int encoder, int strict)
      ^
2961. {
2962.     const char *codec_string = encoder ? "encoder" : "decoder";

ffmpeg.c:2962:32: Condition is true
2960. static enum CodecID find_codec_or_die(const char *name, int type, int encoder, int strict)
2961. {
2962.     const char *codec_string = encoder ? "encoder" : "decoder";
                                     ^
2963.     AVCodec *codec;
2964. 

ffmpeg.c:2962:5: 
2960. static enum CodecID find_codec_or_die(const char *name, int type, int encoder, int strict)
2961. {
2962.     const char *codec_string = encoder ? "encoder" : "decoder";
          ^
2963.     AVCodec *codec;
2964. 

ffmpeg.c:2965:9: Taking false branch
2963.     AVCodec *codec;
2964. 
2965.     if(!name)
              ^
2966.         return CODEC_ID_NONE;
2967.     codec = encoder ?

ffmpeg.c:2967:13: Condition is true
2965.     if(!name)
2966.         return CODEC_ID_NONE;
2967.     codec = encoder ?
                  ^
2968.         avcodec_find_encoder_by_name(name) :
2969.         avcodec_find_decoder_by_name(name);

ffmpeg.c:2967:5: 
2965.     if(!name)
2966.         return CODEC_ID_NONE;
2967.     codec = encoder ?
          ^
2968.         avcodec_find_encoder_by_name(name) :
2969.         avcodec_find_decoder_by_name(name);

ffmpeg.c:2970:9: Taking true branch
2968.         avcodec_find_encoder_by_name(name) :
2969.         avcodec_find_decoder_by_name(name);
2970.     if(!codec) {
              ^
2971.         fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
2972.         ffmpeg_exit(1);

ffmpeg.c:2971:9: 
2969.         avcodec_find_decoder_by_name(name);
2970.     if(!codec) {
2971.         fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
              ^
2972.         ffmpeg_exit(1);
2973.     }

ffmpeg.c:2972:9: Skipping ffmpeg_exit(): empty list of specs
2970.     if(!codec) {
2971.         fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
2972.         ffmpeg_exit(1);
              ^
2973.     }
2974.     if(codec->type != type) {

ffmpeg.c:2974:8: 
2972.         ffmpeg_exit(1);
2973.     }
2974.     if(codec->type != type) {
             ^
2975.         fprintf(stderr, "Invalid %s type '%s'\n", codec_string, name);
2976.         ffmpeg_exit(1);

static enum CodecID find_codec_or_die(const char *name, int type, int encoder, int strict)
{
    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) {
        fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
        ffmpeg_exit(1);
    }
    if(codec->type != type) {
        fprintf(stderr, "Invalid %s type '%s'\n", codec_string, name);
        ffmpeg_exit(1);
    }
    if(codec->capabilities & CODEC_CAP_EXPERIMENTAL &&
       strict > FF_COMPLIANCE_EXPERIMENTAL) {
        fprintf(stderr, "%s '%s' is experimental and might produce bad "
                "results.\nAdd '-strict experimental' if you want to use it.\n",
                codec_string, codec->name);
        codec = encoder ?
            avcodec_find_encoder(codec->id) :
            avcodec_find_decoder(codec->id);
        if (!(codec->capabilities & CODEC_CAP_EXPERIMENTAL))
            fprintf(stderr, "Or use the non experimental %s '%s'.\n",
                    codec_string, codec->name);
        ffmpeg_exit(1);
    }
    return codec->id;
}
['static enum CodecID find_codec_or_die(const char *name, int type, int encoder, int strict)\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        fprintf(stderr, "Unknown %s \'%s\'\\n", codec_string, name);\n        ffmpeg_exit(1);\n    }\n    if(codec->type != type) {\n        fprintf(stderr, "Invalid %s type \'%s\'\\n", codec_string, name);\n        ffmpeg_exit(1);\n    }\n    if(codec->capabilities & CODEC_CAP_EXPERIMENTAL &&\n       strict > FF_COMPLIANCE_EXPERIMENTAL) {\n        fprintf(stderr, "%s \'%s\' is experimental and might produce bad "\n                "results.\\nAdd \'-strict experimental\' if you want to use it.\\n",\n                codec_string, codec->name);\n        codec = encoder ?\n            avcodec_find_encoder(codec->id) :\n            avcodec_find_decoder(codec->id);\n        if (!(codec->capabilities & CODEC_CAP_EXPERIMENTAL))\n            fprintf(stderr, "Or use the non experimental %s \'%s\'.\\n",\n                    codec_string, codec->name);\n        ffmpeg_exit(1);\n    }\n    return codec->id;\n}']