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

ffmpeg.c:2844:1: start of procedure find_codec_or_die()
2842. }
2843. 
2844. static enum CodecID find_codec_or_die(const char *name, int type, int encoder)
      ^
2845. {
2846.     const char *codec_string = encoder ? "encoder" : "decoder";

ffmpeg.c:2846:32: Condition is true
2844. static enum CodecID find_codec_or_die(const char *name, int type, int encoder)
2845. {
2846.     const char *codec_string = encoder ? "encoder" : "decoder";
                                     ^
2847.     AVCodec *codec;
2848. 

ffmpeg.c:2846:5: 
2844. static enum CodecID find_codec_or_die(const char *name, int type, int encoder)
2845. {
2846.     const char *codec_string = encoder ? "encoder" : "decoder";
          ^
2847.     AVCodec *codec;
2848. 

ffmpeg.c:2849:9: Taking false branch
2847.     AVCodec *codec;
2848. 
2849.     if(!name)
              ^
2850.         return CODEC_ID_NONE;
2851.     codec = encoder ?

ffmpeg.c:2851:13: Condition is true
2849.     if(!name)
2850.         return CODEC_ID_NONE;
2851.     codec = encoder ?
                  ^
2852.         avcodec_find_encoder_by_name(name) :
2853.         avcodec_find_decoder_by_name(name);

ffmpeg.c:2851:5: 
2849.     if(!name)
2850.         return CODEC_ID_NONE;
2851.     codec = encoder ?
          ^
2852.         avcodec_find_encoder_by_name(name) :
2853.         avcodec_find_decoder_by_name(name);

ffmpeg.c:2854:9: Taking true branch
2852.         avcodec_find_encoder_by_name(name) :
2853.         avcodec_find_decoder_by_name(name);
2854.     if(!codec) {
              ^
2855.         fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
2856.         av_exit(1);

ffmpeg.c:2855:9: 
2853.         avcodec_find_decoder_by_name(name);
2854.     if(!codec) {
2855.         fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
              ^
2856.         av_exit(1);
2857.     }

ffmpeg.c:2856:9: Skipping av_exit(): empty list of specs
2854.     if(!codec) {
2855.         fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
2856.         av_exit(1);
              ^
2857.     }
2858.     if(codec->type != type) {

ffmpeg.c:2858:8: 
2856.         av_exit(1);
2857.     }
2858.     if(codec->type != type) {
             ^
2859.         fprintf(stderr, "Invalid %s type '%s'\n", codec_string, name);
2860.         av_exit(1);
