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

ffmpeg.c:3090:1: start of procedure opt_input_ts_scale()
3088. }
3089. 
3090. static int opt_input_ts_scale(const char *opt, const char *arg)
      ^
3091. {
3092.     unsigned int stream;

ffmpeg.c:3096:5: 
3094.     char *p;
3095. 
3096.     stream = strtol(arg, &p, 0);
          ^
3097.     if (*p)
3098.         p++;

ffmpeg.c:3097:9: Taking false branch
3095. 
3096.     stream = strtol(arg, &p, 0);
3097.     if (*p)
              ^
3098.         p++;
3099.     scale= strtod(p, &p);

ffmpeg.c:3099:5: 
3097.     if (*p)
3098.         p++;
3099.     scale= strtod(p, &p);
          ^
3100. 
3101.     ts_scale = grow_array(ts_scale, sizeof(*ts_scale), &nb_ts_scale, stream + 1);

ffmpeg.c:3101:5: 
3099.     scale= strtod(p, &p);
3100. 
3101.     ts_scale = grow_array(ts_scale, sizeof(*ts_scale), &nb_ts_scale, stream + 1);
          ^
3102.     ts_scale[stream] = scale;
3103.     return 0;

ffmpeg.c:534:1: start of procedure grow_array()
  532. 
  533. /* similar to ff_dynarray_add() and av_fast_realloc() */
  534. static void *grow_array(void *array, int elem_size, int *size, int new_size)
       ^
  535. {
  536.     if (new_size >= INT_MAX / elem_size) {

ffmpeg.c:536:9: Taking true branch
  534. static void *grow_array(void *array, int elem_size, int *size, int new_size)
  535. {
  536.     if (new_size >= INT_MAX / elem_size) {
               ^
  537.         fprintf(stderr, "Array too big.\n");
  538.         ffmpeg_exit(1);

ffmpeg.c:537:9: 
  535. {
  536.     if (new_size >= INT_MAX / elem_size) {
  537.         fprintf(stderr, "Array too big.\n");
               ^
  538.         ffmpeg_exit(1);
  539.     }

ffmpeg.c:538:9: Skipping ffmpeg_exit(): empty list of specs
  536.     if (new_size >= INT_MAX / elem_size) {
  537.         fprintf(stderr, "Array too big.\n");
  538.         ffmpeg_exit(1);
               ^
  539.     }
  540.     if (*size < new_size) {

ffmpeg.c:540:9: Taking true branch
  538.         ffmpeg_exit(1);
  539.     }
  540.     if (*size < new_size) {
               ^
  541.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  542.         if (!tmp) {

ffmpeg.c:541:9: 
  539.     }
  540.     if (*size < new_size) {
  541.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
               ^
  542.         if (!tmp) {
  543.             fprintf(stderr, "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)

ffmpeg.c:542:14: Taking true branch
  540.     if (*size < new_size) {
  541.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  542.         if (!tmp) {
                    ^
  543.             fprintf(stderr, "Could not alloc buffer.\n");
  544.             ffmpeg_exit(1);

ffmpeg.c:543:13: 
  541.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  542.         if (!tmp) {
  543.             fprintf(stderr, "Could not alloc buffer.\n");
                   ^
  544.             ffmpeg_exit(1);
  545.         }

ffmpeg.c:544:13: Skipping ffmpeg_exit(): empty list of specs
  542.         if (!tmp) {
  543.             fprintf(stderr, "Could not alloc buffer.\n");
  544.             ffmpeg_exit(1);
                   ^
  545.         }
  546.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);

ffmpeg.c:546:9: 
  544.             ffmpeg_exit(1);
  545.         }
  546.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
               ^
  547.         *size = new_size;
  548.         return tmp;

ffmpeg.c:547:9: 
  545.         }
  546.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  547.         *size = new_size;
               ^
  548.         return tmp;
  549.     }

ffmpeg.c:548:9: 
  546.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  547.         *size = new_size;
  548.         return tmp;
               ^
  549.     }
  550.     return array;

ffmpeg.c:551:1: return from a call to grow_array
  549.     }
  550.     return array;
  551. }
       ^
  552. 
  553. static void choose_sample_fmt(AVStream *st, AVCodec *codec)

ffmpeg.c:3102:5: 
3100. 
3101.     ts_scale = grow_array(ts_scale, sizeof(*ts_scale), &nb_ts_scale, stream + 1);
3102.     ts_scale[stream] = scale;
          ^
3103.     return 0;
3104. }
