avconv.c:2773: error: Null Dereference
  pointer `ts_scale` last assigned on line 2772 could be null and is dereferenced at line 2773, column 5.

avconv.c:2761:1: start of procedure opt_input_ts_scale()
2759. }
2760. 
2761. static int opt_input_ts_scale(const char *opt, const char *arg)
      ^
2762. {
2763.     unsigned int stream;

avconv.c:2767:5: 
2765.     char *p;
2766. 
2767.     stream = strtol(arg, &p, 0);
          ^
2768.     if (*p)
2769.         p++;

avconv.c:2768:9: Taking false branch
2766. 
2767.     stream = strtol(arg, &p, 0);
2768.     if (*p)
              ^
2769.         p++;
2770.     scale= strtod(p, &p);

avconv.c:2770:5: 
2768.     if (*p)
2769.         p++;
2770.     scale= strtod(p, &p);
          ^
2771. 
2772.     ts_scale = grow_array(ts_scale, sizeof(*ts_scale), &nb_ts_scale, stream + 1);

avconv.c:2772:5: 
2770.     scale= strtod(p, &p);
2771. 
2772.     ts_scale = grow_array(ts_scale, sizeof(*ts_scale), &nb_ts_scale, stream + 1);
          ^
2773.     ts_scale[stream] = scale;
2774.     return 0;

avconv.c:515:1: start of procedure grow_array()
  513. 
  514. /* similar to ff_dynarray_add() and av_fast_realloc() */
  515. static void *grow_array(void *array, int elem_size, int *size, int new_size)
       ^
  516. {
  517.     if (new_size >= INT_MAX / elem_size) {

avconv.c:517:9: Taking true branch
  515. static void *grow_array(void *array, int elem_size, int *size, int new_size)
  516. {
  517.     if (new_size >= INT_MAX / elem_size) {
               ^
  518.         fprintf(stderr, "Array too big.\n");
  519.         exit_program(1);

avconv.c:518:9: 
  516. {
  517.     if (new_size >= INT_MAX / elem_size) {
  518.         fprintf(stderr, "Array too big.\n");
               ^
  519.         exit_program(1);
  520.     }

avconv.c:519:9: Skipping exit_program(): empty list of specs
  517.     if (new_size >= INT_MAX / elem_size) {
  518.         fprintf(stderr, "Array too big.\n");
  519.         exit_program(1);
               ^
  520.     }
  521.     if (*size < new_size) {

avconv.c:521:9: Taking true branch
  519.         exit_program(1);
  520.     }
  521.     if (*size < new_size) {
               ^
  522.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  523.         if (!tmp) {

avconv.c:522:9: 
  520.     }
  521.     if (*size < new_size) {
  522.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
               ^
  523.         if (!tmp) {
  524.             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)

avconv.c:523:14: Taking true branch
  521.     if (*size < new_size) {
  522.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  523.         if (!tmp) {
                    ^
  524.             fprintf(stderr, "Could not alloc buffer.\n");
  525.             exit_program(1);

avconv.c:524:13: 
  522.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  523.         if (!tmp) {
  524.             fprintf(stderr, "Could not alloc buffer.\n");
                   ^
  525.             exit_program(1);
  526.         }

avconv.c:525:13: Skipping exit_program(): empty list of specs
  523.         if (!tmp) {
  524.             fprintf(stderr, "Could not alloc buffer.\n");
  525.             exit_program(1);
                   ^
  526.         }
  527.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);

avconv.c:527:9: 
  525.             exit_program(1);
  526.         }
  527.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
               ^
  528.         *size = new_size;
  529.         return tmp;

avconv.c:528:9: 
  526.         }
  527.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  528.         *size = new_size;
               ^
  529.         return tmp;
  530.     }

avconv.c:529:9: 
  527.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  528.         *size = new_size;
  529.         return tmp;
               ^
  530.     }
  531.     return array;

avconv.c:532:1: return from a call to grow_array
  530.     }
  531.     return array;
  532. }
       ^
  533. 
  534. static void choose_sample_fmt(AVStream *st, AVCodec *codec)

avconv.c:2773:5: 
2771. 
2772.     ts_scale = grow_array(ts_scale, sizeof(*ts_scale), &nb_ts_scale, stream + 1);
2773.     ts_scale[stream] = scale;
          ^
2774.     return 0;
2775. }
