avconv.c:2961: error: Null Dereference
  pointer `o->attachments` last assigned on line 2959 could be null and is dereferenced at line 2961, column 5.

avconv.c:2957:1: start of procedure opt_attach()
2955. }
2956. 
2957. static int opt_attach(OptionsContext *o, const char *opt, const char *arg)
      ^
2958. {
2959.     o->attachments = grow_array(o->attachments, sizeof(*o->attachments),

avconv.c:2959:5: 
2957. static int opt_attach(OptionsContext *o, const char *opt, const char *arg)
2958. {
2959.     o->attachments = grow_array(o->attachments, sizeof(*o->attachments),
          ^
2960.                                 &o->nb_attachments, o->nb_attachments + 1);
2961.     o->attachments[o->nb_attachments - 1] = arg;

cmdutils.c:1098:1: start of procedure grow_array()
  1096. #endif /* CONFIG_AVFILTER */
  1097. 
  1098. void *grow_array(void *array, int elem_size, int *size, int new_size)
        ^
  1099. {
  1100.     if (new_size >= INT_MAX / elem_size) {

cmdutils.c:1100:9: Taking true branch
  1098. void *grow_array(void *array, int elem_size, int *size, int new_size)
  1099. {
  1100.     if (new_size >= INT_MAX / elem_size) {
                ^
  1101.         av_log(NULL, AV_LOG_ERROR, "Array too big.\n");
  1102.         exit_program(1);

cmdutils.c:1101:9: Skipping av_log(): empty list of specs
  1099. {
  1100.     if (new_size >= INT_MAX / elem_size) {
  1101.         av_log(NULL, AV_LOG_ERROR, "Array too big.\n");
                ^
  1102.         exit_program(1);
  1103.     }

cmdutils.c:1102:9: Skipping exit_program(): empty list of specs
  1100.     if (new_size >= INT_MAX / elem_size) {
  1101.         av_log(NULL, AV_LOG_ERROR, "Array too big.\n");
  1102.         exit_program(1);
                ^
  1103.     }
  1104.     if (*size < new_size) {

cmdutils.c:1104:9: Taking true branch
  1102.         exit_program(1);
  1103.     }
  1104.     if (*size < new_size) {
                ^
  1105.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  1106.         if (!tmp) {

cmdutils.c:1105:9: 
  1103.     }
  1104.     if (*size < new_size) {
  1105.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
                ^
  1106.         if (!tmp) {
  1107.             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:1106:14: Taking true branch
  1104.     if (*size < new_size) {
  1105.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  1106.         if (!tmp) {
                     ^
  1107.             av_log(NULL, AV_LOG_ERROR, "Could not alloc buffer.\n");
  1108.             exit_program(1);

cmdutils.c:1107:13: Skipping av_log(): empty list of specs
  1105.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  1106.         if (!tmp) {
  1107.             av_log(NULL, AV_LOG_ERROR, "Could not alloc buffer.\n");
                    ^
  1108.             exit_program(1);
  1109.         }

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

cmdutils.c:1110:9: 
  1108.             exit_program(1);
  1109.         }
  1110.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
                ^
  1111.         *size = new_size;
  1112.         return tmp;

cmdutils.c:1111:9: 
  1109.         }
  1110.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  1111.         *size = new_size;
                ^
  1112.         return tmp;
  1113.     }

cmdutils.c:1112:9: 
  1110.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  1111.         *size = new_size;
  1112.         return tmp;
                ^
  1113.     }
  1114.     return array;

cmdutils.c:1115:1: return from a call to grow_array
  1113.     }
  1114.     return array;
  1115. }
        ^

avconv.c:2961:5: 
2959.     o->attachments = grow_array(o->attachments, sizeof(*o->attachments),
2960.                                 &o->nb_attachments, o->nb_attachments + 1);
2961.     o->attachments[o->nb_attachments - 1] = arg;
          ^
2962.     return 0;
2963. }
