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

ffmpeg.c:2820:1: start of procedure find_codec_or_die()
2818. }
2819. 
2820. static enum CodecID find_codec_or_die(const char *name, int type, int encoder)
      ^
2821. {
2822.     const char *codec_string = encoder ? "encoder" : "decoder";

ffmpeg.c:2822:32: Condition is true
2820. static enum CodecID find_codec_or_die(const char *name, int type, int encoder)
2821. {
2822.     const char *codec_string = encoder ? "encoder" : "decoder";
                                     ^
2823.     AVCodec *codec;
2824. 

ffmpeg.c:2822:5: 
2820. static enum CodecID find_codec_or_die(const char *name, int type, int encoder)
2821. {
2822.     const char *codec_string = encoder ? "encoder" : "decoder";
          ^
2823.     AVCodec *codec;
2824. 

ffmpeg.c:2825:9: Taking false branch
2823.     AVCodec *codec;
2824. 
2825.     if(!name)
              ^
2826.         return CODEC_ID_NONE;
2827.     codec = encoder ?

ffmpeg.c:2827:13: Condition is true
2825.     if(!name)
2826.         return CODEC_ID_NONE;
2827.     codec = encoder ?
                  ^
2828.         avcodec_find_encoder_by_name(name) :
2829.         avcodec_find_decoder_by_name(name);

ffmpeg.c:2827:5: 
2825.     if(!name)
2826.         return CODEC_ID_NONE;
2827.     codec = encoder ?
          ^
2828.         avcodec_find_encoder_by_name(name) :
2829.         avcodec_find_decoder_by_name(name);

ffmpeg.c:2830:9: Taking true branch
2828.         avcodec_find_encoder_by_name(name) :
2829.         avcodec_find_decoder_by_name(name);
2830.     if(!codec) {
              ^
2831.         fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
2832.         av_exit(1);

ffmpeg.c:2831:9: 
2829.         avcodec_find_decoder_by_name(name);
2830.     if(!codec) {
2831.         fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
              ^
2832.         av_exit(1);
2833.     }

ffmpeg.c:2832:9: Skipping av_exit(): empty list of specs
2830.     if(!codec) {
2831.         fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
2832.         av_exit(1);
              ^
2833.     }
2834.     if(codec->type != type) {

ffmpeg.c:2834:8: 
2832.         av_exit(1);
2833.     }
2834.     if(codec->type != type) {
             ^
2835.         fprintf(stderr, "Invalid %s type '%s'\n", codec_string, name);
2836.         av_exit(1);
