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

ffmpeg.c:2799:1: start of procedure find_codec_or_die()
2797. }
2798. 
2799. static enum CodecID find_codec_or_die(const char *name, int type, int encoder)
      ^
2800. {
2801.     const char *codec_string = encoder ? "encoder" : "decoder";

ffmpeg.c:2801:32: Condition is true
2799. static enum CodecID find_codec_or_die(const char *name, int type, int encoder)
2800. {
2801.     const char *codec_string = encoder ? "encoder" : "decoder";
                                     ^
2802.     AVCodec *codec;
2803. 

ffmpeg.c:2801:5: 
2799. static enum CodecID find_codec_or_die(const char *name, int type, int encoder)
2800. {
2801.     const char *codec_string = encoder ? "encoder" : "decoder";
          ^
2802.     AVCodec *codec;
2803. 

ffmpeg.c:2804:9: Taking false branch
2802.     AVCodec *codec;
2803. 
2804.     if(!name)
              ^
2805.         return CODEC_ID_NONE;
2806.     codec = encoder ?

ffmpeg.c:2806:13: Condition is true
2804.     if(!name)
2805.         return CODEC_ID_NONE;
2806.     codec = encoder ?
                  ^
2807.         avcodec_find_encoder_by_name(name) :
2808.         avcodec_find_decoder_by_name(name);

ffmpeg.c:2806:5: 
2804.     if(!name)
2805.         return CODEC_ID_NONE;
2806.     codec = encoder ?
          ^
2807.         avcodec_find_encoder_by_name(name) :
2808.         avcodec_find_decoder_by_name(name);

ffmpeg.c:2809:9: Taking true branch
2807.         avcodec_find_encoder_by_name(name) :
2808.         avcodec_find_decoder_by_name(name);
2809.     if(!codec) {
              ^
2810.         fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
2811.         av_exit(1);

ffmpeg.c:2810:9: 
2808.         avcodec_find_decoder_by_name(name);
2809.     if(!codec) {
2810.         fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
              ^
2811.         av_exit(1);
2812.     }

ffmpeg.c:2811:9: Skipping av_exit(): empty list of specs
2809.     if(!codec) {
2810.         fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
2811.         av_exit(1);
              ^
2812.     }
2813.     if(codec->type != type) {

ffmpeg.c:2813:8: 
2811.         av_exit(1);
2812.     }
2813.     if(codec->type != type) {
             ^
2814.         fprintf(stderr, "Invalid %s type '%s'\n", codec_string, name);
2815.         av_exit(1);
