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

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

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

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

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

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

libavcodec/utils.c:273:17: when calling `av_free` here
  271.             av_free(buf->extended_data[0]);
  272.             if (buf->extended_data != buf->data)
  273.                 av_free(&buf->extended_data);
                       ^
  274.             buf->extended_data = NULL;
  275.             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:260:24: use-after-lifetime part of the trace starts here
258.     /* allocate InternalBuffer if needed */
259.     if (!avci->buffer) {
260.         avci->buffer = av_mallocz(sizeof(InternalBuffer));
                            ^
261.         if (!avci->buffer)
262.             return AVERROR(ENOMEM);

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

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

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

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

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