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

ffmpeg.c:3072:1: start of procedure find_codec_or_die()
3070. }
3071. 
3072. static enum CodecID find_codec_or_die(const char *name, int type, int encoder, int strict)
      ^
3073. {
3074.     const char *codec_string = encoder ? "encoder" : "decoder";

ffmpeg.c:3074:32: Condition is true
3072. static enum CodecID find_codec_or_die(const char *name, int type, int encoder, int strict)
3073. {
3074.     const char *codec_string = encoder ? "encoder" : "decoder";
                                     ^
3075.     AVCodec *codec;
3076. 

ffmpeg.c:3074:5: 
3072. static enum CodecID find_codec_or_die(const char *name, int type, int encoder, int strict)
3073. {
3074.     const char *codec_string = encoder ? "encoder" : "decoder";
          ^
3075.     AVCodec *codec;
3076. 

ffmpeg.c:3077:9: Taking false branch
3075.     AVCodec *codec;
3076. 
3077.     if(!name)
              ^
3078.         return CODEC_ID_NONE;
3079.     codec = encoder ?

ffmpeg.c:3079:13: Condition is true
3077.     if(!name)
3078.         return CODEC_ID_NONE;
3079.     codec = encoder ?
                  ^
3080.         avcodec_find_encoder_by_name(name) :
3081.         avcodec_find_decoder_by_name(name);

ffmpeg.c:3079:5: 
3077.     if(!name)
3078.         return CODEC_ID_NONE;
3079.     codec = encoder ?
          ^
3080.         avcodec_find_encoder_by_name(name) :
3081.         avcodec_find_decoder_by_name(name);

ffmpeg.c:3082:9: Taking true branch
3080.         avcodec_find_encoder_by_name(name) :
3081.         avcodec_find_decoder_by_name(name);
3082.     if(!codec) {
              ^
3083.         fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
3084.         ffmpeg_exit(1);

ffmpeg.c:3083:9: 
3081.         avcodec_find_decoder_by_name(name);
3082.     if(!codec) {
3083.         fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
              ^
3084.         ffmpeg_exit(1);
3085.     }

ffmpeg.c:3084:9: Skipping ffmpeg_exit(): empty list of specs
3082.     if(!codec) {
3083.         fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
3084.         ffmpeg_exit(1);
              ^
3085.     }
3086.     if(codec->type != type) {

ffmpeg.c:3086:8: 
3084.         ffmpeg_exit(1);
3085.     }
3086.     if(codec->type != type) {
             ^
3087.         fprintf(stderr, "Invalid %s type '%s'\n", codec_string, name);
3088.         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}']