libavformat/movenchint.c:242: error: Use After Free
  call to `sample_queue_pop()` eventually accesses memory that was invalidated by call to `free()` on line 242 indirectly during the call to `sample_queue_pop()`.

libavformat/movenchint.c:213:1: invalidation part of the trace starts here
211.  * @return 0 if a match was found, < 0 if no match was found
212.  */
213. static int find_sample_match(const uint8_t *data, int len,
     ^
214.                              HintSampleQueue *queue, int *pos,
215.                              int *match_sample, int *match_offset,

libavformat/movenchint.c:213:1: parameter `queue` of find_sample_match
  211.  * @return 0 if a match was found, < 0 if no match was found
  212.  */
  213. static int find_sample_match(const uint8_t *data, int len,
       ^
  214.                              HintSampleQueue *queue, int *pos,
  215.                              int *match_sample, int *match_offset,

libavformat/movenchint.c:242:13: when calling `sample_queue_pop` here
  240.         } else {
  241.             /* No match for this sample, remove it */
  242.             sample_queue_pop(queue);
                   ^
  243.         }
  244.     }

libavformat/movenchint.c:69:1: parameter `queue` of sample_queue_pop
    67.  * Remove the first sample from the sample queue.
    68.  */
    69. static void sample_queue_pop(HintSampleQueue *queue)
        ^
    70. {
    71.     if (queue->len <= 0)

libavformat/movenchint.c:74:9: when calling `av_free` here
    72.         return;
    73.     if (queue->samples[0].own_data)
    74.         av_free(queue->samples[0].data);
                ^
    75.     queue->len--;
    76.     memmove(queue->samples, queue->samples + 1, sizeof(HintSample)*queue->len);

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

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

libavformat/movenchint.c:213:1: use-after-lifetime part of the trace starts here
211.  * @return 0 if a match was found, < 0 if no match was found
212.  */
213. static int find_sample_match(const uint8_t *data, int len,
     ^
214.                              HintSampleQueue *queue, int *pos,
215.                              int *match_sample, int *match_offset,

libavformat/movenchint.c:213:1: parameter `queue` of find_sample_match
  211.  * @return 0 if a match was found, < 0 if no match was found
  212.  */
  213. static int find_sample_match(const uint8_t *data, int len,
       ^
  214.                              HintSampleQueue *queue, int *pos,
  215.                              int *match_sample, int *match_offset,

libavformat/movenchint.c:242:13: when calling `sample_queue_pop` here
  240.         } else {
  241.             /* No match for this sample, remove it */
  242.             sample_queue_pop(queue);
                   ^
  243.         }
  244.     }

libavformat/movenchint.c:69:1: parameter `queue` of sample_queue_pop
    67.  * Remove the first sample from the sample queue.
    68.  */
    69. static void sample_queue_pop(HintSampleQueue *queue)
        ^
    70. {
    71.     if (queue->len <= 0)

libavformat/movenchint.c:74:9: when calling `av_free` here
    72.         return;
    73.     if (queue->samples[0].own_data)
    74.         av_free(queue->samples[0].data);
                ^
    75.     queue->len--;
    76.     memmove(queue->samples, queue->samples + 1, sizeof(HintSample)*queue->len);

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

libavutil/mem.c:145:5: invalid access occurs here
      143.         free((char*)ptr - ((char*)ptr)[-1]);
      144. #else
      145.     free(ptr);
               ^
      146. #endif
      147. }
