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

ffmpeg.c:3112:1: start of procedure find_codec_or_die()
3110. }
3111. 
3112. static enum CodecID find_codec_or_die(const char *name, int type, int encoder)
      ^
3113. {
3114.     const char *codec_string = encoder ? "encoder" : "decoder";

ffmpeg.c:3114:32: Condition is true
3112. static enum CodecID find_codec_or_die(const char *name, int type, int encoder)
3113. {
3114.     const char *codec_string = encoder ? "encoder" : "decoder";
                                     ^
3115.     AVCodec *codec;
3116. 

ffmpeg.c:3114:5: 
3112. static enum CodecID find_codec_or_die(const char *name, int type, int encoder)
3113. {
3114.     const char *codec_string = encoder ? "encoder" : "decoder";
          ^
3115.     AVCodec *codec;
3116. 

ffmpeg.c:3117:9: Taking false branch
3115.     AVCodec *codec;
3116. 
3117.     if(!name)
              ^
3118.         return CODEC_ID_NONE;
3119.     codec = encoder ?

ffmpeg.c:3119:13: Condition is true
3117.     if(!name)
3118.         return CODEC_ID_NONE;
3119.     codec = encoder ?
                  ^
3120.         avcodec_find_encoder_by_name(name) :
3121.         avcodec_find_decoder_by_name(name);

ffmpeg.c:3119:5: 
3117.     if(!name)
3118.         return CODEC_ID_NONE;
3119.     codec = encoder ?
          ^
3120.         avcodec_find_encoder_by_name(name) :
3121.         avcodec_find_decoder_by_name(name);

ffmpeg.c:3122:9: Taking true branch
3120.         avcodec_find_encoder_by_name(name) :
3121.         avcodec_find_decoder_by_name(name);
3122.     if(!codec) {
              ^
3123.         fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
3124.         exit_program(1);

ffmpeg.c:3123:9: 
3121.         avcodec_find_decoder_by_name(name);
3122.     if(!codec) {
3123.         fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
              ^
3124.         exit_program(1);
3125.     }

ffmpeg.c:3124:9: Skipping exit_program(): empty list of specs
3122.     if(!codec) {
3123.         fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
3124.         exit_program(1);
              ^
3125.     }
3126.     if(codec->type != type) {

ffmpeg.c:3126:8: 
3124.         exit_program(1);
3125.     }
3126.     if(codec->type != type) {
             ^
3127.         fprintf(stderr, "Invalid %s type '%s'\n", codec_string, name);
3128.         exit_program(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);
        exit_program(1);
    }
    if(codec->type != type) {
        fprintf(stderr, "Invalid %s type '%s'\n", codec_string, name);
        exit_program(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        exit_program(1);\n    }\n    if(codec->type != type) {\n        fprintf(stderr, "Invalid %s type \'%s\'\\n", codec_string, name);\n        exit_program(1);\n    }\n    return codec->id;\n}']