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

ffmpeg.c:3125:1: start of procedure find_codec_or_die()
3123. }
3124. 
3125. static enum CodecID find_codec_or_die(const char *name, int type, int encoder, int strict)
      ^
3126. {
3127.     const char *codec_string = encoder ? "encoder" : "decoder";

ffmpeg.c:3127:32: Condition is true
3125. static enum CodecID find_codec_or_die(const char *name, int type, int encoder, int strict)
3126. {
3127.     const char *codec_string = encoder ? "encoder" : "decoder";
                                     ^
3128.     AVCodec *codec;
3129. 

ffmpeg.c:3127:5: 
3125. static enum CodecID find_codec_or_die(const char *name, int type, int encoder, int strict)
3126. {
3127.     const char *codec_string = encoder ? "encoder" : "decoder";
          ^
3128.     AVCodec *codec;
3129. 

ffmpeg.c:3130:9: Taking false branch
3128.     AVCodec *codec;
3129. 
3130.     if(!name)
              ^
3131.         return CODEC_ID_NONE;
3132.     codec = encoder ?

ffmpeg.c:3132:13: Condition is true
3130.     if(!name)
3131.         return CODEC_ID_NONE;
3132.     codec = encoder ?
                  ^
3133.         avcodec_find_encoder_by_name(name) :
3134.         avcodec_find_decoder_by_name(name);

ffmpeg.c:3132:5: 
3130.     if(!name)
3131.         return CODEC_ID_NONE;
3132.     codec = encoder ?
          ^
3133.         avcodec_find_encoder_by_name(name) :
3134.         avcodec_find_decoder_by_name(name);

ffmpeg.c:3135:9: Taking true branch
3133.         avcodec_find_encoder_by_name(name) :
3134.         avcodec_find_decoder_by_name(name);
3135.     if(!codec) {
              ^
3136.         fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
3137.         ffmpeg_exit(1);

ffmpeg.c:3136:9: 
3134.         avcodec_find_decoder_by_name(name);
3135.     if(!codec) {
3136.         fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
              ^
3137.         ffmpeg_exit(1);
3138.     }

ffmpeg.c:3137:9: Skipping ffmpeg_exit(): empty list of specs
3135.     if(!codec) {
3136.         fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
3137.         ffmpeg_exit(1);
              ^
3138.     }
3139.     if(codec->type != type) {

ffmpeg.c:3139:8: 
3137.         ffmpeg_exit(1);
3138.     }
3139.     if(codec->type != type) {
             ^
3140.         fprintf(stderr, "Invalid %s type '%s'\n", codec_string, name);
3141.         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}']