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

ffmpeg.c:2812:1: start of procedure find_codec_or_die()
2810. }
2811. 
2812. static enum CodecID find_codec_or_die(const char *name, int type, int encoder)
      ^
2813. {
2814.     const char *codec_string = encoder ? "encoder" : "decoder";

ffmpeg.c:2814:32: Condition is true
2812. static enum CodecID find_codec_or_die(const char *name, int type, int encoder)
2813. {
2814.     const char *codec_string = encoder ? "encoder" : "decoder";
                                     ^
2815.     AVCodec *codec;
2816. 

ffmpeg.c:2814:5: 
2812. static enum CodecID find_codec_or_die(const char *name, int type, int encoder)
2813. {
2814.     const char *codec_string = encoder ? "encoder" : "decoder";
          ^
2815.     AVCodec *codec;
2816. 

ffmpeg.c:2817:9: Taking false branch
2815.     AVCodec *codec;
2816. 
2817.     if(!name)
              ^
2818.         return CODEC_ID_NONE;
2819.     codec = encoder ?

ffmpeg.c:2819:13: Condition is true
2817.     if(!name)
2818.         return CODEC_ID_NONE;
2819.     codec = encoder ?
                  ^
2820.         avcodec_find_encoder_by_name(name) :
2821.         avcodec_find_decoder_by_name(name);

ffmpeg.c:2819:5: 
2817.     if(!name)
2818.         return CODEC_ID_NONE;
2819.     codec = encoder ?
          ^
2820.         avcodec_find_encoder_by_name(name) :
2821.         avcodec_find_decoder_by_name(name);

ffmpeg.c:2822:9: Taking true branch
2820.         avcodec_find_encoder_by_name(name) :
2821.         avcodec_find_decoder_by_name(name);
2822.     if(!codec) {
              ^
2823.         fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
2824.         av_exit(1);

ffmpeg.c:2823:9: 
2821.         avcodec_find_decoder_by_name(name);
2822.     if(!codec) {
2823.         fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
              ^
2824.         av_exit(1);
2825.     }

ffmpeg.c:2824:9: Skipping av_exit(): empty list of specs
2822.     if(!codec) {
2823.         fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
2824.         av_exit(1);
              ^
2825.     }
2826.     if(codec->type != type) {

ffmpeg.c:2826:8: 
2824.         av_exit(1);
2825.     }
2826.     if(codec->type != type) {
             ^
2827.         fprintf(stderr, "Invalid %s type '%s'\n", codec_string, name);
2828.         av_exit(1);
