ffmpeg.c:2594: error: Null Dereference
  pointer `mid` last assigned on line 2594 could be null and is dereferenced at line 2594, column 5.

ffmpeg.c:2586:1: start of procedure opt_metadata()
2584. }
2585. 
2586. static int opt_metadata(const char *opt, const char *arg)
      ^
2587. {
2588.     char *mid= strchr(arg, '=');

ffmpeg.c:2588:5: 
2586. static int opt_metadata(const char *opt, const char *arg)
2587. {
2588.     char *mid= strchr(arg, '=');
          ^
2589. 
2590.     if(!mid){

ffmpeg.c:2590:9: Taking true branch
2588.     char *mid= strchr(arg, '=');
2589. 
2590.     if(!mid){
              ^
2591.         fprintf(stderr, "Missing =\n");
2592.         av_exit(1);

ffmpeg.c:2591:9: 
2589. 
2590.     if(!mid){
2591.         fprintf(stderr, "Missing =\n");
              ^
2592.         av_exit(1);
2593.     }

ffmpeg.c:2592:9: Skipping av_exit(): empty list of specs
2590.     if(!mid){
2591.         fprintf(stderr, "Missing =\n");
2592.         av_exit(1);
              ^
2593.     }
2594.     *mid++= 0;

ffmpeg.c:2594:5: 
2592.         av_exit(1);
2593.     }
2594.     *mid++= 0;
          ^
2595. 
2596.     metadata_count++;

static int opt_metadata(const char *opt, const char *arg)
{
    char *mid= strchr(arg, '=');
    if(!mid){
        fprintf(stderr, "Missing =\n");
        av_exit(1);
    }
    *mid++= 0;
    metadata_count++;
    metadata= av_realloc(metadata, sizeof(*metadata)*metadata_count);
    metadata[metadata_count-1].key  = av_strdup(arg);
    metadata[metadata_count-1].value= av_strdup(mid);
    return 0;
}
['static int opt_metadata(const char *opt, const char *arg)\n{\n    char *mid= strchr(arg, \'=\');\n    if(!mid){\n        fprintf(stderr, "Missing =\\n");\n        av_exit(1);\n    }\n    *mid++= 0;\n    metadata_count++;\n    metadata= av_realloc(metadata, sizeof(*metadata)*metadata_count);\n    metadata[metadata_count-1].key  = av_strdup(arg);\n    metadata[metadata_count-1].value= av_strdup(mid);\n    return 0;\n}']