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

avconv.c:2912:1: start of procedure opt_input_ts_scale()
2910. }
2911. 
2912. static int opt_input_ts_scale(const char *opt, const char *arg)
      ^
2913. {
2914.     unsigned int stream;

avconv.c:2918:5: 
2916.     char *p;
2917. 
2918.     stream = strtol(arg, &p, 0);
          ^
2919.     if (*p)
2920.         p++;

avconv.c:2919:9: Taking true branch
2917. 
2918.     stream = strtol(arg, &p, 0);
2919.     if (*p)
              ^
2920.         p++;
2921.     scale= strtod(p, &p);

avconv.c:2920:9: 
2918.     stream = strtol(arg, &p, 0);
2919.     if (*p)
2920.         p++;
              ^
2921.     scale= strtod(p, &p);
2922. 

avconv.c:2921:5: 
2919.     if (*p)
2920.         p++;
2921.     scale= strtod(p, &p);
          ^
2922. 
2923.     ts_scale = grow_array(ts_scale, sizeof(*ts_scale), &nb_ts_scale, stream + 1);

avconv.c:2923:5: 
2921.     scale= strtod(p, &p);
2922. 
2923.     ts_scale = grow_array(ts_scale, sizeof(*ts_scale), &nb_ts_scale, stream + 1);
          ^
2924.     ts_scale[stream] = scale;
2925.     return 0;

avconv.c:526:1: start of procedure grow_array()
  524. 
  525. /* similar to ff_dynarray_add() and av_fast_realloc() */
  526. static void *grow_array(void *array, int elem_size, int *size, int new_size)
       ^
  527. {
  528.     if (new_size >= INT_MAX / elem_size) {

avconv.c:528:9: Taking true branch
  526. static void *grow_array(void *array, int elem_size, int *size, int new_size)
  527. {
  528.     if (new_size >= INT_MAX / elem_size) {
               ^
  529.         fprintf(stderr, "Array too big.\n");
  530.         exit_program(1);

avconv.c:529:9: 
  527. {
  528.     if (new_size >= INT_MAX / elem_size) {
  529.         fprintf(stderr, "Array too big.\n");
               ^
  530.         exit_program(1);
  531.     }

avconv.c:530:9: Skipping exit_program(): empty list of specs
  528.     if (new_size >= INT_MAX / elem_size) {
  529.         fprintf(stderr, "Array too big.\n");
  530.         exit_program(1);
               ^
  531.     }
  532.     if (*size < new_size) {

avconv.c:532:9: Taking true branch
  530.         exit_program(1);
  531.     }
  532.     if (*size < new_size) {
               ^
  533.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  534.         if (!tmp) {

avconv.c:533:9: 
  531.     }
  532.     if (*size < new_size) {
  533.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
               ^
  534.         if (!tmp) {
  535.             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 true branch
    122. 
    123.     /* let's disallow possible ambiguous cases */
    124.     if(size > (INT_MAX-16) )
                ^
    125.         return NULL;
    126. 

libavutil/mem.c:125:9: 
    123.     /* let's disallow possible ambiguous cases */
    124.     if(size > (INT_MAX-16) )
    125.         return NULL;
                 ^
    126. 
    127. #if CONFIG_MEMALIGN_HACK

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:534:14: Taking true branch
  532.     if (*size < new_size) {
  533.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  534.         if (!tmp) {
                    ^
  535.             fprintf(stderr, "Could not alloc buffer.\n");
  536.             exit_program(1);

avconv.c:535:13: 
  533.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  534.         if (!tmp) {
  535.             fprintf(stderr, "Could not alloc buffer.\n");
                   ^
  536.             exit_program(1);
  537.         }

avconv.c:536:13: Skipping exit_program(): empty list of specs
  534.         if (!tmp) {
  535.             fprintf(stderr, "Could not alloc buffer.\n");
  536.             exit_program(1);
                   ^
  537.         }
  538.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);

avconv.c:538:9: 
  536.             exit_program(1);
  537.         }
  538.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
               ^
  539.         *size = new_size;
  540.         return tmp;

avconv.c:539:9: 
  537.         }
  538.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  539.         *size = new_size;
               ^
  540.         return tmp;
  541.     }

avconv.c:540:9: 
  538.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  539.         *size = new_size;
  540.         return tmp;
               ^
  541.     }
  542.     return array;

avconv.c:543:1: return from a call to grow_array
  541.     }
  542.     return array;
  543. }
       ^
  544. 
  545. static void choose_sample_fmt(AVStream *st, AVCodec *codec)

avconv.c:2924:5: 
2922. 
2923.     ts_scale = grow_array(ts_scale, sizeof(*ts_scale), &nb_ts_scale, stream + 1);
2924.     ts_scale[stream] = scale;
          ^
2925.     return 0;
2926. }
