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

avconv.c:2693:1: start of procedure opt_attach()
2691. }
2692. 
2693. static int opt_attach(OptionsContext *o, const char *opt, const char *arg)
      ^
2694. {
2695.     o->attachments = grow_array(o->attachments, sizeof(*o->attachments),

avconv.c:2695:5: 
2693. static int opt_attach(OptionsContext *o, const char *opt, const char *arg)
2694. {
2695.     o->attachments = grow_array(o->attachments, sizeof(*o->attachments),
          ^
2696.                                 &o->nb_attachments, o->nb_attachments + 1);
2697.     o->attachments[o->nb_attachments - 1] = arg;

cmdutils.c:1055:1: start of procedure grow_array()
  1053. #endif /* CONFIG_AVFILTER */
  1054. 
  1055. void *grow_array(void *array, int elem_size, int *size, int new_size)
        ^
  1056. {
  1057.     if (new_size >= INT_MAX / elem_size) {

cmdutils.c:1057:9: Taking true branch
  1055. void *grow_array(void *array, int elem_size, int *size, int new_size)
  1056. {
  1057.     if (new_size >= INT_MAX / elem_size) {
                ^
  1058.         av_log(NULL, AV_LOG_ERROR, "Array too big.\n");
  1059.         exit_program(1);

cmdutils.c:1058:9: Skipping av_log(): empty list of specs
  1056. {
  1057.     if (new_size >= INT_MAX / elem_size) {
  1058.         av_log(NULL, AV_LOG_ERROR, "Array too big.\n");
                ^
  1059.         exit_program(1);
  1060.     }

cmdutils.c:1059:9: Skipping exit_program(): empty list of specs
  1057.     if (new_size >= INT_MAX / elem_size) {
  1058.         av_log(NULL, AV_LOG_ERROR, "Array too big.\n");
  1059.         exit_program(1);
                ^
  1060.     }
  1061.     if (*size < new_size) {

cmdutils.c:1061:9: Taking true branch
  1059.         exit_program(1);
  1060.     }
  1061.     if (*size < new_size) {
                ^
  1062.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  1063.         if (!tmp) {

cmdutils.c:1062:9: 
  1060.     }
  1061.     if (*size < new_size) {
  1062.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
                ^
  1063.         if (!tmp) {
  1064.             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:1063:14: Taking true branch
  1061.     if (*size < new_size) {
  1062.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  1063.         if (!tmp) {
                     ^
  1064.             av_log(NULL, AV_LOG_ERROR, "Could not alloc buffer.\n");
  1065.             exit_program(1);

cmdutils.c:1064:13: Skipping av_log(): empty list of specs
  1062.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  1063.         if (!tmp) {
  1064.             av_log(NULL, AV_LOG_ERROR, "Could not alloc buffer.\n");
                    ^
  1065.             exit_program(1);
  1066.         }

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

cmdutils.c:1067:9: 
  1065.             exit_program(1);
  1066.         }
  1067.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
                ^
  1068.         *size = new_size;
  1069.         return tmp;

cmdutils.c:1068:9: 
  1066.         }
  1067.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  1068.         *size = new_size;
                ^
  1069.         return tmp;
  1070.     }

cmdutils.c:1069:9: 
  1067.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  1068.         *size = new_size;
  1069.         return tmp;
                ^
  1070.     }
  1071.     return array;

cmdutils.c:1072:1: return from a call to grow_array
  1070.     }
  1071.     return array;
  1072. }
        ^

avconv.c:2697:5: 
2695.     o->attachments = grow_array(o->attachments, sizeof(*o->attachments),
2696.                                 &o->nb_attachments, o->nb_attachments + 1);
2697.     o->attachments[o->nb_attachments - 1] = arg;
          ^
2698.     return 0;
2699. }
