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

ffmpeg.c:3136:1: start of procedure find_codec_or_die()
3134. }
3135. 
3136. static enum CodecID find_codec_or_die(const char *name, int type, int encoder)
      ^
3137. {
3138.     const char *codec_string = encoder ? "encoder" : "decoder";

ffmpeg.c:3138:32: Condition is false
3136. static enum CodecID find_codec_or_die(const char *name, int type, int encoder)
3137. {
3138.     const char *codec_string = encoder ? "encoder" : "decoder";
                                     ^
3139.     AVCodec *codec;
3140. 

ffmpeg.c:3138:5: 
3136. static enum CodecID find_codec_or_die(const char *name, int type, int encoder)
3137. {
3138.     const char *codec_string = encoder ? "encoder" : "decoder";
          ^
3139.     AVCodec *codec;
3140. 

ffmpeg.c:3141:9: Taking false branch
3139.     AVCodec *codec;
3140. 
3141.     if(!name)
              ^
3142.         return CODEC_ID_NONE;
3143.     codec = encoder ?

ffmpeg.c:3143:13: Condition is false
3141.     if(!name)
3142.         return CODEC_ID_NONE;
3143.     codec = encoder ?
                  ^
3144.         avcodec_find_encoder_by_name(name) :
3145.         avcodec_find_decoder_by_name(name);

ffmpeg.c:3143:5: 
3141.     if(!name)
3142.         return CODEC_ID_NONE;
3143.     codec = encoder ?
          ^
3144.         avcodec_find_encoder_by_name(name) :
3145.         avcodec_find_decoder_by_name(name);

ffmpeg.c:3146:9: Taking true branch
3144.         avcodec_find_encoder_by_name(name) :
3145.         avcodec_find_decoder_by_name(name);
3146.     if(!codec) {
              ^
3147.         fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
3148.         ffmpeg_exit(1);

ffmpeg.c:3147:9: 
3145.         avcodec_find_decoder_by_name(name);
3146.     if(!codec) {
3147.         fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
              ^
3148.         ffmpeg_exit(1);
3149.     }

ffmpeg.c:3148:9: Skipping ffmpeg_exit(): empty list of specs
3146.     if(!codec) {
3147.         fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
3148.         ffmpeg_exit(1);
              ^
3149.     }
3150.     if(codec->type != type) {

ffmpeg.c:3150:8: 
3148.         ffmpeg_exit(1);
3149.     }
3150.     if(codec->type != type) {
             ^
3151.         fprintf(stderr, "Invalid %s type '%s'\n", codec_string, name);
3152.         ffmpeg_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) {
        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);
    }
    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        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    return codec->id;\n}']