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

ffmpeg.c:3066:1: start of procedure opt_input_ts_scale()
3064. }
3065. 
3066. static int opt_input_ts_scale(const char *opt, const char *arg)
      ^
3067. {
3068.     unsigned int stream;

ffmpeg.c:3072:5: 
3070.     char *p;
3071. 
3072.     stream = strtol(arg, &p, 0);
          ^
3073.     if (*p)
3074.         p++;

ffmpeg.c:3073:9: Taking true branch
3071. 
3072.     stream = strtol(arg, &p, 0);
3073.     if (*p)
              ^
3074.         p++;
3075.     scale= strtod(p, &p);

ffmpeg.c:3074:9: 
3072.     stream = strtol(arg, &p, 0);
3073.     if (*p)
3074.         p++;
              ^
3075.     scale= strtod(p, &p);
3076. 

ffmpeg.c:3075:5: 
3073.     if (*p)
3074.         p++;
3075.     scale= strtod(p, &p);
          ^
3076. 
3077.     ts_scale = grow_array(ts_scale, sizeof(*ts_scale), &nb_ts_scale, stream + 1);

ffmpeg.c:3077:5: 
3075.     scale= strtod(p, &p);
3076. 
3077.     ts_scale = grow_array(ts_scale, sizeof(*ts_scale), &nb_ts_scale, stream + 1);
          ^
3078.     ts_scale[stream] = scale;
3079.     return 0;

cmdutils.c:994:1: start of procedure grow_array()
  992. #endif /* CONFIG_AVFILTER */
  993. 
  994. void *grow_array(void *array, int elem_size, int *size, int new_size)
       ^
  995. {
  996.     if (new_size >= INT_MAX / elem_size) {

cmdutils.c:996:9: Taking true branch
  994. void *grow_array(void *array, int elem_size, int *size, int new_size)
  995. {
  996.     if (new_size >= INT_MAX / elem_size) {
               ^
  997.         av_log(NULL, AV_LOG_ERROR, "Array too big.\n");
  998.         exit_program(1);

cmdutils.c:997:9: Skipping av_log(): empty list of specs
  995. {
  996.     if (new_size >= INT_MAX / elem_size) {
  997.         av_log(NULL, AV_LOG_ERROR, "Array too big.\n");
               ^
  998.         exit_program(1);
  999.     }

cmdutils.c:998:9: Skipping exit_program(): empty list of specs
   996.     if (new_size >= INT_MAX / elem_size) {
   997.         av_log(NULL, AV_LOG_ERROR, "Array too big.\n");
   998.         exit_program(1);
                ^
   999.     }
  1000.     if (*size < new_size) {

cmdutils.c:1000:9: Taking true branch
   998.         exit_program(1);
   999.     }
  1000.     if (*size < new_size) {
                ^
  1001.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  1002.         if (!tmp) {

cmdutils.c:1001:9: 
   999.     }
  1000.     if (*size < new_size) {
  1001.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
                ^
  1002.         if (!tmp) {
  1003.             av_log(NULL, AV_LOG_ERROR, "Could not alloc buffer.\n");

libavutil/mem.c:117:1: start of procedure av_realloc()
    115. }
    116. 
    117. void *av_realloc(void *ptr, size_t size)
         ^
    118. {
    119. #if CONFIG_MEMALIGN_HACK

libavutil/mem.c:124:8: Taking false branch
    122. 
    123.     /* let's disallow possible ambiguous cases */
    124.     if(size > (INT_MAX-16) )
                ^
    125.         return NULL;
    126. 

libavutil/mem.c:133:5: 
    131.     return (char*)realloc((char*)ptr - diff, size + diff) + diff;
    132. #else
    133.     return realloc(ptr, size);
             ^
    134. #endif
    135. }

libavutil/mem.c:135:1: return from a call to av_realloc
    133.     return realloc(ptr, size);
    134. #endif
    135. }
         ^
    136. 
    137. void av_free(void *ptr)

cmdutils.c:1002:14: Taking true branch
  1000.     if (*size < new_size) {
  1001.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  1002.         if (!tmp) {
                     ^
  1003.             av_log(NULL, AV_LOG_ERROR, "Could not alloc buffer.\n");
  1004.             exit_program(1);

cmdutils.c:1003:13: Skipping av_log(): empty list of specs
  1001.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  1002.         if (!tmp) {
  1003.             av_log(NULL, AV_LOG_ERROR, "Could not alloc buffer.\n");
                    ^
  1004.             exit_program(1);
  1005.         }

cmdutils.c:1004:13: Skipping exit_program(): empty list of specs
  1002.         if (!tmp) {
  1003.             av_log(NULL, AV_LOG_ERROR, "Could not alloc buffer.\n");
  1004.             exit_program(1);
                    ^
  1005.         }
  1006.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);

cmdutils.c:1006:9: 
  1004.             exit_program(1);
  1005.         }
  1006.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
                ^
  1007.         *size = new_size;
  1008.         return tmp;

cmdutils.c:1007:9: 
  1005.         }
  1006.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  1007.         *size = new_size;
                ^
  1008.         return tmp;
  1009.     }

cmdutils.c:1008:9: 
  1006.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  1007.         *size = new_size;
  1008.         return tmp;
                ^
  1009.     }
  1010.     return array;

cmdutils.c:1011:1: return from a call to grow_array
  1009.     }
  1010.     return array;
  1011. }
        ^

ffmpeg.c:3078:5: 
3076. 
3077.     ts_scale = grow_array(ts_scale, sizeof(*ts_scale), &nb_ts_scale, stream + 1);
3078.     ts_scale[stream] = scale;
          ^
3079.     return 0;
3080. }
