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

ffmpeg.c:2828:1: start of procedure find_codec_or_die()
2826. }
2827. 
2828. static enum CodecID find_codec_or_die(const char *name, int type, int encoder)
      ^
2829. {
2830.     const char *codec_string = encoder ? "encoder" : "decoder";

ffmpeg.c:2830:32: Condition is true
2828. static enum CodecID find_codec_or_die(const char *name, int type, int encoder)
2829. {
2830.     const char *codec_string = encoder ? "encoder" : "decoder";
                                     ^
2831.     AVCodec *codec;
2832. 

ffmpeg.c:2830:5: 
2828. static enum CodecID find_codec_or_die(const char *name, int type, int encoder)
2829. {
2830.     const char *codec_string = encoder ? "encoder" : "decoder";
          ^
2831.     AVCodec *codec;
2832. 

ffmpeg.c:2833:9: Taking false branch
2831.     AVCodec *codec;
2832. 
2833.     if(!name)
              ^
2834.         return CODEC_ID_NONE;
2835.     codec = encoder ?

ffmpeg.c:2835:13: Condition is true
2833.     if(!name)
2834.         return CODEC_ID_NONE;
2835.     codec = encoder ?
                  ^
2836.         avcodec_find_encoder_by_name(name) :
2837.         avcodec_find_decoder_by_name(name);

ffmpeg.c:2835:5: 
2833.     if(!name)
2834.         return CODEC_ID_NONE;
2835.     codec = encoder ?
          ^
2836.         avcodec_find_encoder_by_name(name) :
2837.         avcodec_find_decoder_by_name(name);

ffmpeg.c:2838:9: Taking true branch
2836.         avcodec_find_encoder_by_name(name) :
2837.         avcodec_find_decoder_by_name(name);
2838.     if(!codec) {
              ^
2839.         fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
2840.         av_exit(1);

ffmpeg.c:2839:9: 
2837.         avcodec_find_decoder_by_name(name);
2838.     if(!codec) {
2839.         fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
              ^
2840.         av_exit(1);
2841.     }

ffmpeg.c:2840:9: Skipping av_exit(): empty list of specs
2838.     if(!codec) {
2839.         fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
2840.         av_exit(1);
              ^
2841.     }
2842.     if(codec->type != type) {

ffmpeg.c:2842:8: 
2840.         av_exit(1);
2841.     }
2842.     if(codec->type != type) {
             ^
2843.         fprintf(stderr, "Invalid %s type '%s'\n", codec_string, name);
2844.         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}']