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

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

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

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

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

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

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

cmdutils.c:963:1: start of procedure grow_array()
  961. }
  962. 
  963. void *grow_array(void *array, int elem_size, int *size, int new_size)
       ^
  964. {
  965.     if (new_size >= INT_MAX / elem_size) {

cmdutils.c:965:9: Taking true branch
  963. void *grow_array(void *array, int elem_size, int *size, int new_size)
  964. {
  965.     if (new_size >= INT_MAX / elem_size) {
               ^
  966.         av_log(NULL, AV_LOG_ERROR, "Array too big.\n");
  967.         exit_program(1);

cmdutils.c:966:9: Skipping av_log(): empty list of specs
  964. {
  965.     if (new_size >= INT_MAX / elem_size) {
  966.         av_log(NULL, AV_LOG_ERROR, "Array too big.\n");
               ^
  967.         exit_program(1);
  968.     }

cmdutils.c:967:9: Skipping exit_program(): empty list of specs
  965.     if (new_size >= INT_MAX / elem_size) {
  966.         av_log(NULL, AV_LOG_ERROR, "Array too big.\n");
  967.         exit_program(1);
               ^
  968.     }
  969.     if (*size < new_size) {

cmdutils.c:969:9: Taking true branch
  967.         exit_program(1);
  968.     }
  969.     if (*size < new_size) {
               ^
  970.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  971.         if (!tmp) {

cmdutils.c:970:9: 
  968.     }
  969.     if (*size < new_size) {
  970.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
               ^
  971.         if (!tmp) {
  972.             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:971:14: Taking true branch
  969.     if (*size < new_size) {
  970.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  971.         if (!tmp) {
                    ^
  972.             av_log(NULL, AV_LOG_ERROR, "Could not alloc buffer.\n");
  973.             exit_program(1);

cmdutils.c:972:13: Skipping av_log(): empty list of specs
  970.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  971.         if (!tmp) {
  972.             av_log(NULL, AV_LOG_ERROR, "Could not alloc buffer.\n");
                   ^
  973.             exit_program(1);
  974.         }

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

cmdutils.c:975:9: 
  973.             exit_program(1);
  974.         }
  975.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
               ^
  976.         *size = new_size;
  977.         return tmp;

cmdutils.c:976:9: 
  974.         }
  975.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  976.         *size = new_size;
               ^
  977.         return tmp;
  978.     }

cmdutils.c:977:9: 
  975.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  976.         *size = new_size;
  977.         return tmp;
               ^
  978.     }
  979.     return array;

cmdutils.c:980:1: return from a call to grow_array
  978.     }
  979.     return array;
  980. }
       ^
  981. 
  982. #endif /* CONFIG_AVFILTER */

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