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

ffmpeg.c:3133:1: start of procedure find_codec_or_die()
3131. }
3132. 
3133. static enum CodecID find_codec_or_die(const char *name, int type, int encoder)
      ^
3134. {
3135.     const char *codec_string = encoder ? "encoder" : "decoder";

ffmpeg.c:3135:32: Condition is true
3133. static enum CodecID find_codec_or_die(const char *name, int type, int encoder)
3134. {
3135.     const char *codec_string = encoder ? "encoder" : "decoder";
                                     ^
3136.     AVCodec *codec;
3137. 

ffmpeg.c:3135:5: 
3133. static enum CodecID find_codec_or_die(const char *name, int type, int encoder)
3134. {
3135.     const char *codec_string = encoder ? "encoder" : "decoder";
          ^
3136.     AVCodec *codec;
3137. 

ffmpeg.c:3138:9: Taking false branch
3136.     AVCodec *codec;
3137. 
3138.     if(!name)
              ^
3139.         return CODEC_ID_NONE;
3140.     codec = encoder ?

ffmpeg.c:3140:13: Condition is true
3138.     if(!name)
3139.         return CODEC_ID_NONE;
3140.     codec = encoder ?
                  ^
3141.         avcodec_find_encoder_by_name(name) :
3142.         avcodec_find_decoder_by_name(name);

ffmpeg.c:3140:5: 
3138.     if(!name)
3139.         return CODEC_ID_NONE;
3140.     codec = encoder ?
          ^
3141.         avcodec_find_encoder_by_name(name) :
3142.         avcodec_find_decoder_by_name(name);

ffmpeg.c:3143:9: Taking true branch
3141.         avcodec_find_encoder_by_name(name) :
3142.         avcodec_find_decoder_by_name(name);
3143.     if(!codec) {
              ^
3144.         fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
3145.         ffmpeg_exit(1);

ffmpeg.c:3144:9: 
3142.         avcodec_find_decoder_by_name(name);
3143.     if(!codec) {
3144.         fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
              ^
3145.         ffmpeg_exit(1);
3146.     }

ffmpeg.c:3145:9: Skipping ffmpeg_exit(): empty list of specs
3143.     if(!codec) {
3144.         fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
3145.         ffmpeg_exit(1);
              ^
3146.     }
3147.     if(codec->type != type) {

ffmpeg.c:3147:8: 
3145.         ffmpeg_exit(1);
3146.     }
3147.     if(codec->type != type) {
             ^
3148.         fprintf(stderr, "Invalid %s type '%s'\n", codec_string, name);
3149.         ffmpeg_exit(1);
