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

ffmpeg.c:2763:1: start of procedure find_codec_or_die()
2761. }
2762. 
2763. static enum CodecID find_codec_or_die(const char *name, int type, int encoder)
      ^
2764. {
2765.     const char *codec_string = encoder ? "encoder" : "decoder";

ffmpeg.c:2765:32: Condition is true
2763. static enum CodecID find_codec_or_die(const char *name, int type, int encoder)
2764. {
2765.     const char *codec_string = encoder ? "encoder" : "decoder";
                                     ^
2766.     AVCodec *codec;
2767. 

ffmpeg.c:2765:5: 
2763. static enum CodecID find_codec_or_die(const char *name, int type, int encoder)
2764. {
2765.     const char *codec_string = encoder ? "encoder" : "decoder";
          ^
2766.     AVCodec *codec;
2767. 

ffmpeg.c:2768:9: Taking false branch
2766.     AVCodec *codec;
2767. 
2768.     if(!name)
              ^
2769.         return CODEC_ID_NONE;
2770.     codec = encoder ?

ffmpeg.c:2770:13: Condition is true
2768.     if(!name)
2769.         return CODEC_ID_NONE;
2770.     codec = encoder ?
                  ^
2771.         avcodec_find_encoder_by_name(name) :
2772.         avcodec_find_decoder_by_name(name);

ffmpeg.c:2770:5: 
2768.     if(!name)
2769.         return CODEC_ID_NONE;
2770.     codec = encoder ?
          ^
2771.         avcodec_find_encoder_by_name(name) :
2772.         avcodec_find_decoder_by_name(name);

ffmpeg.c:2773:9: Taking true branch
2771.         avcodec_find_encoder_by_name(name) :
2772.         avcodec_find_decoder_by_name(name);
2773.     if(!codec) {
              ^
2774.         av_log(NULL, AV_LOG_ERROR, "Unknown %s '%s'\n", codec_string, name);
2775.         av_exit(1);

ffmpeg.c:2774:9: Skipping av_log(): empty list of specs
2772.         avcodec_find_decoder_by_name(name);
2773.     if(!codec) {
2774.         av_log(NULL, AV_LOG_ERROR, "Unknown %s '%s'\n", codec_string, name);
              ^
2775.         av_exit(1);
2776.     }

ffmpeg.c:2775:9: Skipping av_exit(): empty list of specs
2773.     if(!codec) {
2774.         av_log(NULL, AV_LOG_ERROR, "Unknown %s '%s'\n", codec_string, name);
2775.         av_exit(1);
              ^
2776.     }
2777.     if(codec->type != type) {

ffmpeg.c:2777:8: 
2775.         av_exit(1);
2776.     }
2777.     if(codec->type != type) {
             ^
2778.         av_log(NULL, AV_LOG_ERROR, "Invalid %s type '%s'\n", codec_string, name);
2779.         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) {
        av_log(NULL, AV_LOG_ERROR, "Unknown %s '%s'\n", codec_string, name);
        av_exit(1);
    }
    if(codec->type != type) {
        av_log(NULL, AV_LOG_ERROR, "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        av_log(NULL, AV_LOG_ERROR, "Unknown %s \'%s\'\\n", codec_string, name);\n        av_exit(1);\n    }\n    if(codec->type != type) {\n        av_log(NULL, AV_LOG_ERROR, "Invalid %s type \'%s\'\\n", codec_string, name);\n        av_exit(1);\n    }\n    return codec->id;\n}']