libavcodec/utils.c:273: error: Use After Free
  accessing memory that was invalidated by call to `free()` on line 272 indirectly during the call to `av_free()`.

libavcodec/utils.c:259:24: invalidation part of the trace starts here
257.     /* allocate InternalBuffer if needed */
258.     if (!avci->buffer) {
259.         avci->buffer = av_mallocz(sizeof(InternalBuffer));
                            ^
260.         if (!avci->buffer)
261.             return AVERROR(ENOMEM);

libavcodec/utils.c:259:24: passed as argument to `av_mallocz`
  257.     /* allocate InternalBuffer if needed */
  258.     if (!avci->buffer) {
  259.         avci->buffer = av_mallocz(sizeof(InternalBuffer));
                              ^
  260.         if (!avci->buffer)
  261.             return AVERROR(ENOMEM);

libavcodec/utils.c:259:24: return from call to `av_mallocz`
  257.     /* allocate InternalBuffer if needed */
  258.     if (!avci->buffer) {
  259.         avci->buffer = av_mallocz(sizeof(InternalBuffer));
                              ^
  260.         if (!avci->buffer)
  261.             return AVERROR(ENOMEM);

libavcodec/utils.c:259:9: assigned
  257.     /* allocate InternalBuffer if needed */
  258.     if (!avci->buffer) {
  259.         avci->buffer = av_mallocz(sizeof(InternalBuffer));
               ^
  260.         if (!avci->buffer)
  261.             return AVERROR(ENOMEM);

libavcodec/utils.c:263:5: assigned
  261.             return AVERROR(ENOMEM);
  262.     }
  263.     buf = avci->buffer;
           ^
  264. 
  265.     /* if there is a previously-used internal buffer, check its size and

libavcodec/utils.c:272:17: when calling `av_free` here
  270.             av_free(buf->extended_data[0]);
  271.             if (buf->extended_data != buf->data)
  272.                 av_free(&buf->extended_data);
                       ^
  273.             buf->extended_data = NULL;
  274.             buf->data[0] = NULL;

libavutil/mem.c:137:1: parameter `ptr` of av_free
    135. }
    136. 
    137. void av_free(void *ptr)
         ^
    138. {
    139. #if CONFIG_MEMALIGN_HACK

libavutil/mem.c:143:5: was invalidated by call to `free()`
    141.         free((char*)ptr - ((char*)ptr)[-1]);
    142. #else
    143.     free(ptr);
             ^
    144. #endif
    145. }

libavcodec/utils.c:259:24: use-after-lifetime part of the trace starts here
257.     /* allocate InternalBuffer if needed */
258.     if (!avci->buffer) {
259.         avci->buffer = av_mallocz(sizeof(InternalBuffer));
                            ^
260.         if (!avci->buffer)
261.             return AVERROR(ENOMEM);

libavcodec/utils.c:259:24: passed as argument to `av_mallocz`
  257.     /* allocate InternalBuffer if needed */
  258.     if (!avci->buffer) {
  259.         avci->buffer = av_mallocz(sizeof(InternalBuffer));
                              ^
  260.         if (!avci->buffer)
  261.             return AVERROR(ENOMEM);

libavcodec/utils.c:259:24: return from call to `av_mallocz`
  257.     /* allocate InternalBuffer if needed */
  258.     if (!avci->buffer) {
  259.         avci->buffer = av_mallocz(sizeof(InternalBuffer));
                              ^
  260.         if (!avci->buffer)
  261.             return AVERROR(ENOMEM);

libavcodec/utils.c:259:9: assigned
  257.     /* allocate InternalBuffer if needed */
  258.     if (!avci->buffer) {
  259.         avci->buffer = av_mallocz(sizeof(InternalBuffer));
               ^
  260.         if (!avci->buffer)
  261.             return AVERROR(ENOMEM);

libavcodec/utils.c:263:5: assigned
  261.             return AVERROR(ENOMEM);
  262.     }
  263.     buf = avci->buffer;
           ^
  264. 
  265.     /* if there is a previously-used internal buffer, check its size and

libavcodec/utils.c:273:13: invalid access occurs here
  271.             if (buf->extended_data != buf->data)
  272.                 av_free(&buf->extended_data);
  273.             buf->extended_data = NULL;
                   ^
  274.             buf->data[0] = NULL;
  275.         }
