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

ffmpeg.c:3078:1: start of procedure find_codec_or_die()
3076. }
3077. 
3078. static enum CodecID find_codec_or_die(const char *name, int type, int encoder)
      ^
3079. {
3080.     const char *codec_string = encoder ? "encoder" : "decoder";

ffmpeg.c:3080:32: Condition is true
3078. static enum CodecID find_codec_or_die(const char *name, int type, int encoder)
3079. {
3080.     const char *codec_string = encoder ? "encoder" : "decoder";
                                     ^
3081.     AVCodec *codec;
3082. 

ffmpeg.c:3080:5: 
3078. static enum CodecID find_codec_or_die(const char *name, int type, int encoder)
3079. {
3080.     const char *codec_string = encoder ? "encoder" : "decoder";
          ^
3081.     AVCodec *codec;
3082. 

ffmpeg.c:3083:9: Taking false branch
3081.     AVCodec *codec;
3082. 
3083.     if(!name)
              ^
3084.         return CODEC_ID_NONE;
3085.     codec = encoder ?

ffmpeg.c:3085:13: Condition is true
3083.     if(!name)
3084.         return CODEC_ID_NONE;
3085.     codec = encoder ?
                  ^
3086.         avcodec_find_encoder_by_name(name) :
3087.         avcodec_find_decoder_by_name(name);

ffmpeg.c:3085:5: 
3083.     if(!name)
3084.         return CODEC_ID_NONE;
3085.     codec = encoder ?
          ^
3086.         avcodec_find_encoder_by_name(name) :
3087.         avcodec_find_decoder_by_name(name);

ffmpeg.c:3088:9: Taking true branch
3086.         avcodec_find_encoder_by_name(name) :
3087.         avcodec_find_decoder_by_name(name);
3088.     if(!codec) {
              ^
3089.         fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
3090.         av_exit(1);

ffmpeg.c:3089:9: 
3087.         avcodec_find_decoder_by_name(name);
3088.     if(!codec) {
3089.         fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
              ^
3090.         av_exit(1);
3091.     }

ffmpeg.c:3090:9: Skipping av_exit(): empty list of specs
3088.     if(!codec) {
3089.         fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
3090.         av_exit(1);
              ^
3091.     }
3092.     if(codec->type != type) {

ffmpeg.c:3092:8: 
3090.         av_exit(1);
3091.     }
3092.     if(codec->type != type) {
             ^
3093.         fprintf(stderr, "Invalid %s type '%s'\n", codec_string, name);
3094.         av_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);
        av_exit(1);
    }
    if(codec->type != type) {
        fprintf(stderr, "Invalid %s type '%s'\n", codec_string, name);
        av_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        av_exit(1);\n    }\n    if(codec->type != type) {\n        fprintf(stderr, "Invalid %s type \'%s\'\\n", codec_string, name);\n        av_exit(1);\n    }\n    return codec->id;\n}']