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

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

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

ffmpeg.c:3139:5: 
3137. static enum CodecID find_codec_or_die(const char *name, int type, int encoder)
3138. {
3139.     const char *codec_string = encoder ? "encoder" : "decoder";
          ^
3140.     AVCodec *codec;
3141. 

ffmpeg.c:3142:9: Taking false branch
3140.     AVCodec *codec;
3141. 
3142.     if(!name)
              ^
3143.         return CODEC_ID_NONE;
3144.     codec = encoder ?

ffmpeg.c:3144:13: Condition is true
3142.     if(!name)
3143.         return CODEC_ID_NONE;
3144.     codec = encoder ?
                  ^
3145.         avcodec_find_encoder_by_name(name) :
3146.         avcodec_find_decoder_by_name(name);

ffmpeg.c:3144:5: 
3142.     if(!name)
3143.         return CODEC_ID_NONE;
3144.     codec = encoder ?
          ^
3145.         avcodec_find_encoder_by_name(name) :
3146.         avcodec_find_decoder_by_name(name);

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

ffmpeg.c:3148:9: 
3146.         avcodec_find_decoder_by_name(name);
3147.     if(!codec) {
3148.         fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
              ^
3149.         ffmpeg_exit(1);
3150.     }

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

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