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

libavformat/matroskadec.c:976:1: start of procedure matroska_decode_buffer()
974. }
975. 
976. static int
     ^
977. matroska_decode_buffer(uint8_t** buf, int* buf_size, MatroskaTrack *track)
978. {

libavformat/matroskadec.c:979:5: 
977. matroska_decode_buffer(uint8_t** buf, int* buf_size, MatroskaTrack *track)
978. {
979.     uint8_t* data = *buf;
         ^
980.     int isize = *buf_size;
981.     uint8_t* pkt_data = NULL;

libavformat/matroskadec.c:980:5: 
978. {
979.     uint8_t* data = *buf;
980.     int isize = *buf_size;
         ^
981.     uint8_t* pkt_data = NULL;
982.     int pkt_size = isize;

libavformat/matroskadec.c:981:5: 
979.     uint8_t* data = *buf;
980.     int isize = *buf_size;
981.     uint8_t* pkt_data = NULL;
         ^
982.     int pkt_size = isize;
983.     int result = 0;

libavformat/matroskadec.c:982:5: 
980.     int isize = *buf_size;
981.     uint8_t* pkt_data = NULL;
982.     int pkt_size = isize;
         ^
983.     int result = 0;
984.     int olen;

libavformat/matroskadec.c:983:5: 
981.     uint8_t* pkt_data = NULL;
982.     int pkt_size = isize;
983.     int result = 0;
         ^
984.     int olen;
985. 

libavformat/matroskadec.c:986:5: 
984.     int olen;
985. 
986.     switch (track->encoding_algo) {
         ^
987.     case MATROSKA_TRACK_ENCODING_COMP_HEADERSTRIP:
988.         return track->encoding_settings_len;

libavformat/matroskadec.c:987:5: Switch condition is false. Skipping switch case
985. 
986.     switch (track->encoding_algo) {
987.     case MATROSKA_TRACK_ENCODING_COMP_HEADERSTRIP:
         ^
988.         return track->encoding_settings_len;
989.     case MATROSKA_TRACK_ENCODING_COMP_LZO:

libavformat/matroskadec.c:989:5: Switch condition is false. Skipping switch case
987.     case MATROSKA_TRACK_ENCODING_COMP_HEADERSTRIP:
988.         return track->encoding_settings_len;
989.     case MATROSKA_TRACK_ENCODING_COMP_LZO:
         ^
990.         do {
991.             olen = pkt_size *= 3;

libavformat/matroskadec.c:1001:5: Switch condition is true. Entering switch case
 999.         break;
1000. #ifdef CONFIG_ZLIB
1001.     case MATROSKA_TRACK_ENCODING_COMP_ZLIB: {
          ^
1002.         z_stream zstream = {0};
1003.         if (inflateInit(&zstream) != Z_OK)

libavformat/matroskadec.c:1002:9: 
1000. #ifdef CONFIG_ZLIB
1001.     case MATROSKA_TRACK_ENCODING_COMP_ZLIB: {
1002.         z_stream zstream = {0};
              ^
1003.         if (inflateInit(&zstream) != Z_OK)
1004.             return -1;

libavformat/matroskadec.c:1003:13: Taking false branch
1001.     case MATROSKA_TRACK_ENCODING_COMP_ZLIB: {
1002.         z_stream zstream = {0};
1003.         if (inflateInit(&zstream) != Z_OK)
                  ^
1004.             return -1;
1005.         zstream.next_in = data;

libavformat/matroskadec.c:1005:9: 
1003.         if (inflateInit(&zstream) != Z_OK)
1004.             return -1;
1005.         zstream.next_in = data;
              ^
1006.         zstream.avail_in = isize;
1007.         do {

libavformat/matroskadec.c:1006:9: 
1004.             return -1;
1005.         zstream.next_in = data;
1006.         zstream.avail_in = isize;
              ^
1007.         do {
1008.             pkt_size *= 3;

libavformat/matroskadec.c:1008:13: 
1006.         zstream.avail_in = isize;
1007.         do {
1008.             pkt_size *= 3;
                  ^
1009.             pkt_data = av_realloc(pkt_data, pkt_size);
1010.             zstream.avail_out = pkt_size - zstream.total_out;

libavformat/matroskadec.c:1009:13: 
1007.         do {
1008.             pkt_size *= 3;
1009.             pkt_data = av_realloc(pkt_data, pkt_size);
                  ^
1010.             zstream.avail_out = pkt_size - zstream.total_out;
1011.             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:1010:13: 
1008.             pkt_size *= 3;
1009.             pkt_data = av_realloc(pkt_data, pkt_size);
1010.             zstream.avail_out = pkt_size - zstream.total_out;
                  ^
1011.             zstream.next_out = pkt_data + zstream.total_out;
1012.             result = inflate(&zstream, Z_NO_FLUSH);

libavformat/matroskadec.c:1011:13: 
1009.             pkt_data = av_realloc(pkt_data, pkt_size);
1010.             zstream.avail_out = pkt_size - zstream.total_out;
1011.             zstream.next_out = pkt_data + zstream.total_out;
                  ^
1012.             result = inflate(&zstream, Z_NO_FLUSH);
1013.         } while (result==Z_OK && pkt_size<10000000);

libavformat/matroskadec.c:1012:13: Skipping inflate(): method has no implementation
1010.             zstream.avail_out = pkt_size - zstream.total_out;
1011.             zstream.next_out = pkt_data + zstream.total_out;
1012.             result = inflate(&zstream, Z_NO_FLUSH);
                  ^
1013.         } while (result==Z_OK && pkt_size<10000000);
1014.         pkt_size = zstream.total_out;

libavformat/matroskadec.c:1013:18: Loop condition is true. Entering loop body
1011.             zstream.next_out = pkt_data + zstream.total_out;
1012.             result = inflate(&zstream, Z_NO_FLUSH);
1013.         } while (result==Z_OK && pkt_size<10000000);
                       ^
1014.         pkt_size = zstream.total_out;
1015.         inflateEnd(&zstream);

libavformat/matroskadec.c:1013:34: Loop condition is true. Entering loop body
1011.             zstream.next_out = pkt_data + zstream.total_out;
1012.             result = inflate(&zstream, Z_NO_FLUSH);
1013.         } while (result==Z_OK && pkt_size<10000000);
                                       ^
1014.         pkt_size = zstream.total_out;
1015.         inflateEnd(&zstream);

libavformat/matroskadec.c:1008:13: 
1006.         zstream.avail_in = isize;
1007.         do {
1008.             pkt_size *= 3;
                  ^
1009.             pkt_data = av_realloc(pkt_data, pkt_size);
1010.             zstream.avail_out = pkt_size - zstream.total_out;

libavformat/matroskadec.c:1009:13: 
1007.         do {
1008.             pkt_size *= 3;
1009.             pkt_data = av_realloc(pkt_data, pkt_size);
                  ^
1010.             zstream.avail_out = pkt_size - zstream.total_out;
1011.             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)
