libavformat/matroskadec.c:891: error: Memory Leak
  memory dynamically allocated by call to `av_realloc()` at line 891, column 24 is not reachable after line 891, column 13.

libavformat/matroskadec.c:857:1: start of procedure matroska_decode_buffer()
855. }
856. 
857. static int matroska_decode_buffer(uint8_t** buf, int* buf_size,
     ^
858.                                   MatroskaTrack *track)
859. {

libavformat/matroskadec.c:860:5: 
858.                                   MatroskaTrack *track)
859. {
860.     MatroskaTrackEncoding *encodings = track->encodings.elem;
         ^
861.     uint8_t* data = *buf;
862.     int isize = *buf_size;

libavformat/matroskadec.c:861:5: 
859. {
860.     MatroskaTrackEncoding *encodings = track->encodings.elem;
861.     uint8_t* data = *buf;
         ^
862.     int isize = *buf_size;
863.     uint8_t* pkt_data = NULL;

libavformat/matroskadec.c:862:5: 
860.     MatroskaTrackEncoding *encodings = track->encodings.elem;
861.     uint8_t* data = *buf;
862.     int isize = *buf_size;
         ^
863.     uint8_t* pkt_data = NULL;
864.     int pkt_size = isize;

libavformat/matroskadec.c:863:5: 
861.     uint8_t* data = *buf;
862.     int isize = *buf_size;
863.     uint8_t* pkt_data = NULL;
         ^
864.     int pkt_size = isize;
865.     int result = 0;

libavformat/matroskadec.c:864:5: 
862.     int isize = *buf_size;
863.     uint8_t* pkt_data = NULL;
864.     int pkt_size = isize;
         ^
865.     int result = 0;
866.     int olen;

libavformat/matroskadec.c:865:5: 
863.     uint8_t* pkt_data = NULL;
864.     int pkt_size = isize;
865.     int result = 0;
         ^
866.     int olen;
867. 

libavformat/matroskadec.c:868:5: 
866.     int olen;
867. 
868.     switch (encodings[0].compression.algo) {
         ^
869.     case MATROSKA_TRACK_ENCODING_COMP_HEADERSTRIP:
870.         return encodings[0].compression.settings.size;

libavformat/matroskadec.c:869:5: Switch condition is false. Skipping switch case
867. 
868.     switch (encodings[0].compression.algo) {
869.     case MATROSKA_TRACK_ENCODING_COMP_HEADERSTRIP:
         ^
870.         return encodings[0].compression.settings.size;
871.     case MATROSKA_TRACK_ENCODING_COMP_LZO:

libavformat/matroskadec.c:871:5: Switch condition is false. Skipping switch case
869.     case MATROSKA_TRACK_ENCODING_COMP_HEADERSTRIP:
870.         return encodings[0].compression.settings.size;
871.     case MATROSKA_TRACK_ENCODING_COMP_LZO:
         ^
872.         do {
873.             olen = pkt_size *= 3;

libavformat/matroskadec.c:883:5: Switch condition is true. Entering switch case
881.         break;
882. #ifdef CONFIG_ZLIB
883.     case MATROSKA_TRACK_ENCODING_COMP_ZLIB: {
         ^
884.         z_stream zstream = {0};
885.         if (inflateInit(&zstream) != Z_OK)

libavformat/matroskadec.c:884:9: 
882. #ifdef CONFIG_ZLIB
883.     case MATROSKA_TRACK_ENCODING_COMP_ZLIB: {
884.         z_stream zstream = {0};
             ^
885.         if (inflateInit(&zstream) != Z_OK)
886.             return -1;

libavformat/matroskadec.c:885:13: Taking false branch
883.     case MATROSKA_TRACK_ENCODING_COMP_ZLIB: {
884.         z_stream zstream = {0};
885.         if (inflateInit(&zstream) != Z_OK)
                 ^
886.             return -1;
887.         zstream.next_in = data;

libavformat/matroskadec.c:887:9: 
885.         if (inflateInit(&zstream) != Z_OK)
886.             return -1;
887.         zstream.next_in = data;
             ^
888.         zstream.avail_in = isize;
889.         do {

libavformat/matroskadec.c:888:9: 
886.             return -1;
887.         zstream.next_in = data;
888.         zstream.avail_in = isize;
             ^
889.         do {
890.             pkt_size *= 3;

libavformat/matroskadec.c:890:13: 
888.         zstream.avail_in = isize;
889.         do {
890.             pkt_size *= 3;
                 ^
891.             pkt_data = av_realloc(pkt_data, pkt_size);
892.             zstream.avail_out = pkt_size - zstream.total_out;

libavformat/matroskadec.c:891:13: 
889.         do {
890.             pkt_size *= 3;
891.             pkt_data = av_realloc(pkt_data, pkt_size);
                 ^
892.             zstream.avail_out = pkt_size - zstream.total_out;
893.             zstream.next_out = pkt_data + zstream.total_out;

libavutil/mem.c:94:1: start of procedure av_realloc()
  92. }
  93. 
  94. void *av_realloc(void *ptr, unsigned int size)
      ^
  95. {
  96. #ifdef CONFIG_MEMALIGN_HACK

libavutil/mem.c:101:8: Taking false branch
   99. 
  100.     /* let's disallow possible ambiguous cases */
  101.     if(size > (INT_MAX-16) )
              ^
  102.         return NULL;
  103. 

libavutil/mem.c:110:5: 
  108.     return (char*)realloc((char*)ptr - diff, size + diff) + diff;
  109. #else
  110.     return realloc(ptr, size);
           ^
  111. #endif
  112. }

libavutil/mem.c:112:1: return from a call to av_realloc
  110.     return realloc(ptr, size);
  111. #endif
  112. }
       ^
  113. 
  114. void av_free(void *ptr)

libavformat/matroskadec.c:892:13: 
890.             pkt_size *= 3;
891.             pkt_data = av_realloc(pkt_data, pkt_size);
892.             zstream.avail_out = pkt_size - zstream.total_out;
                 ^
893.             zstream.next_out = pkt_data + zstream.total_out;
894.             result = inflate(&zstream, Z_NO_FLUSH);

libavformat/matroskadec.c:893:13: 
891.             pkt_data = av_realloc(pkt_data, pkt_size);
892.             zstream.avail_out = pkt_size - zstream.total_out;
893.             zstream.next_out = pkt_data + zstream.total_out;
                 ^
894.             result = inflate(&zstream, Z_NO_FLUSH);
895.         } while (result==Z_OK && pkt_size<10000000);

libavformat/matroskadec.c:894:13: Skipping inflate(): method has no implementation
892.             zstream.avail_out = pkt_size - zstream.total_out;
893.             zstream.next_out = pkt_data + zstream.total_out;
894.             result = inflate(&zstream, Z_NO_FLUSH);
                 ^
895.         } while (result==Z_OK && pkt_size<10000000);
896.         pkt_size = zstream.total_out;

libavformat/matroskadec.c:895:18: Loop condition is true. Entering loop body
893.             zstream.next_out = pkt_data + zstream.total_out;
894.             result = inflate(&zstream, Z_NO_FLUSH);
895.         } while (result==Z_OK && pkt_size<10000000);
                      ^
896.         pkt_size = zstream.total_out;
897.         inflateEnd(&zstream);

libavformat/matroskadec.c:895:34: Loop condition is true. Entering loop body
893.             zstream.next_out = pkt_data + zstream.total_out;
894.             result = inflate(&zstream, Z_NO_FLUSH);
895.         } while (result==Z_OK && pkt_size<10000000);
                                      ^
896.         pkt_size = zstream.total_out;
897.         inflateEnd(&zstream);

libavformat/matroskadec.c:890:13: 
888.         zstream.avail_in = isize;
889.         do {
890.             pkt_size *= 3;
                 ^
891.             pkt_data = av_realloc(pkt_data, pkt_size);
892.             zstream.avail_out = pkt_size - zstream.total_out;

libavformat/matroskadec.c:891:13: 
889.         do {
890.             pkt_size *= 3;
891.             pkt_data = av_realloc(pkt_data, pkt_size);
                 ^
892.             zstream.avail_out = pkt_size - zstream.total_out;
893.             zstream.next_out = pkt_data + zstream.total_out;

libavutil/mem.c:94:1: start of procedure av_realloc()
  92. }
  93. 
  94. void *av_realloc(void *ptr, unsigned int size)
      ^
  95. {
  96. #ifdef CONFIG_MEMALIGN_HACK

libavutil/mem.c:101:8: Taking true branch
   99. 
  100.     /* let's disallow possible ambiguous cases */
  101.     if(size > (INT_MAX-16) )
              ^
  102.         return NULL;
  103. 

libavutil/mem.c:102:9: 
  100.     /* let's disallow possible ambiguous cases */
  101.     if(size > (INT_MAX-16) )
  102.         return NULL;
               ^
  103. 
  104. #ifdef CONFIG_MEMALIGN_HACK

libavutil/mem.c:112:1: return from a call to av_realloc
  110.     return realloc(ptr, size);
  111. #endif
  112. }
       ^
  113. 
  114. void av_free(void *ptr)
