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

libavformat/matroskadec.c:929:1: start of procedure matroska_decode_buffer()
927. }
928. 
929. static int matroska_decode_buffer(uint8_t** buf, int* buf_size,
     ^
930.                                   MatroskaTrack *track)
931. {

libavformat/matroskadec.c:932:5: 
930.                                   MatroskaTrack *track)
931. {
932.     MatroskaTrackEncoding *encodings = track->encodings.elem;
         ^
933.     uint8_t* data = *buf;
934.     int isize = *buf_size;

libavformat/matroskadec.c:933:5: 
931. {
932.     MatroskaTrackEncoding *encodings = track->encodings.elem;
933.     uint8_t* data = *buf;
         ^
934.     int isize = *buf_size;
935.     uint8_t* pkt_data = NULL;

libavformat/matroskadec.c:934:5: 
932.     MatroskaTrackEncoding *encodings = track->encodings.elem;
933.     uint8_t* data = *buf;
934.     int isize = *buf_size;
         ^
935.     uint8_t* pkt_data = NULL;
936.     int pkt_size = isize;

libavformat/matroskadec.c:935:5: 
933.     uint8_t* data = *buf;
934.     int isize = *buf_size;
935.     uint8_t* pkt_data = NULL;
         ^
936.     int pkt_size = isize;
937.     int result = 0;

libavformat/matroskadec.c:936:5: 
934.     int isize = *buf_size;
935.     uint8_t* pkt_data = NULL;
936.     int pkt_size = isize;
         ^
937.     int result = 0;
938.     int olen;

libavformat/matroskadec.c:937:5: 
935.     uint8_t* pkt_data = NULL;
936.     int pkt_size = isize;
937.     int result = 0;
         ^
938.     int olen;
939. 

libavformat/matroskadec.c:940:9: Taking false branch
938.     int olen;
939. 
940.     if (pkt_size >= 10000000)
             ^
941.         return -1;
942. 

libavformat/matroskadec.c:943:5: 
941.         return -1;
942. 
943.     switch (encodings[0].compression.algo) {
         ^
944.     case MATROSKA_TRACK_ENCODING_COMP_HEADERSTRIP:
945.         return encodings[0].compression.settings.size;

libavformat/matroskadec.c:944:5: Switch condition is false. Skipping switch case
942. 
943.     switch (encodings[0].compression.algo) {
944.     case MATROSKA_TRACK_ENCODING_COMP_HEADERSTRIP:
         ^
945.         return encodings[0].compression.settings.size;
946.     case MATROSKA_TRACK_ENCODING_COMP_LZO:

libavformat/matroskadec.c:946:5: Switch condition is false. Skipping switch case
944.     case MATROSKA_TRACK_ENCODING_COMP_HEADERSTRIP:
945.         return encodings[0].compression.settings.size;
946.     case MATROSKA_TRACK_ENCODING_COMP_LZO:
         ^
947.         do {
948.             olen = pkt_size *= 3;

libavformat/matroskadec.c:957:5: Switch condition is true. Entering switch case
955.         break;
956. #if CONFIG_ZLIB
957.     case MATROSKA_TRACK_ENCODING_COMP_ZLIB: {
         ^
958.         z_stream zstream = {0};
959.         if (inflateInit(&zstream) != Z_OK)

libavformat/matroskadec.c:958:9: 
956. #if CONFIG_ZLIB
957.     case MATROSKA_TRACK_ENCODING_COMP_ZLIB: {
958.         z_stream zstream = {0};
             ^
959.         if (inflateInit(&zstream) != Z_OK)
960.             return -1;

libavformat/matroskadec.c:959:13: Taking false branch
957.     case MATROSKA_TRACK_ENCODING_COMP_ZLIB: {
958.         z_stream zstream = {0};
959.         if (inflateInit(&zstream) != Z_OK)
                 ^
960.             return -1;
961.         zstream.next_in = data;

libavformat/matroskadec.c:961:9: 
959.         if (inflateInit(&zstream) != Z_OK)
960.             return -1;
961.         zstream.next_in = data;
             ^
962.         zstream.avail_in = isize;
963.         do {

libavformat/matroskadec.c:962:9: 
960.             return -1;
961.         zstream.next_in = data;
962.         zstream.avail_in = isize;
             ^
963.         do {
964.             pkt_size *= 3;

libavformat/matroskadec.c:964:13: 
962.         zstream.avail_in = isize;
963.         do {
964.             pkt_size *= 3;
                 ^
965.             pkt_data = av_realloc(pkt_data, pkt_size);
966.             zstream.avail_out = pkt_size - zstream.total_out;

libavformat/matroskadec.c:965:13: 
963.         do {
964.             pkt_size *= 3;
965.             pkt_data = av_realloc(pkt_data, pkt_size);
                 ^
966.             zstream.avail_out = pkt_size - zstream.total_out;
967.             zstream.next_out = pkt_data + zstream.total_out;

libavutil/mem.c:117:1: start of procedure av_realloc()
  115. }
  116. 
  117. void *av_realloc(void *ptr, size_t size)
       ^
  118. {
  119. #if CONFIG_MEMALIGN_HACK

libavutil/mem.c:124:8: Taking false branch
  122. 
  123.     /* let's disallow possible ambiguous cases */
  124.     if(size > (INT_MAX-16) )
              ^
  125.         return NULL;
  126. 

libavutil/mem.c:133:5: 
  131.     return (char*)realloc((char*)ptr - diff, size + diff) + diff;
  132. #else
  133.     return realloc(ptr, size);
           ^
  134. #endif
  135. }

libavutil/mem.c:135:1: return from a call to av_realloc
  133.     return realloc(ptr, size);
  134. #endif
  135. }
       ^
  136. 
  137. void av_free(void *ptr)

libavformat/matroskadec.c:966:13: 
964.             pkt_size *= 3;
965.             pkt_data = av_realloc(pkt_data, pkt_size);
966.             zstream.avail_out = pkt_size - zstream.total_out;
                 ^
967.             zstream.next_out = pkt_data + zstream.total_out;
968.             result = inflate(&zstream, Z_NO_FLUSH);

libavformat/matroskadec.c:967:13: 
965.             pkt_data = av_realloc(pkt_data, pkt_size);
966.             zstream.avail_out = pkt_size - zstream.total_out;
967.             zstream.next_out = pkt_data + zstream.total_out;
                 ^
968.             result = inflate(&zstream, Z_NO_FLUSH);
969.         } while (result==Z_OK && pkt_size<10000000);

libavformat/matroskadec.c:968:13: Skipping inflate(): method has no implementation
966.             zstream.avail_out = pkt_size - zstream.total_out;
967.             zstream.next_out = pkt_data + zstream.total_out;
968.             result = inflate(&zstream, Z_NO_FLUSH);
                 ^
969.         } while (result==Z_OK && pkt_size<10000000);
970.         pkt_size = zstream.total_out;

libavformat/matroskadec.c:969:18: Loop condition is true. Entering loop body
967.             zstream.next_out = pkt_data + zstream.total_out;
968.             result = inflate(&zstream, Z_NO_FLUSH);
969.         } while (result==Z_OK && pkt_size<10000000);
                      ^
970.         pkt_size = zstream.total_out;
971.         inflateEnd(&zstream);

libavformat/matroskadec.c:969:34: Loop condition is true. Entering loop body
967.             zstream.next_out = pkt_data + zstream.total_out;
968.             result = inflate(&zstream, Z_NO_FLUSH);
969.         } while (result==Z_OK && pkt_size<10000000);
                                      ^
970.         pkt_size = zstream.total_out;
971.         inflateEnd(&zstream);

libavformat/matroskadec.c:964:13: 
962.         zstream.avail_in = isize;
963.         do {
964.             pkt_size *= 3;
                 ^
965.             pkt_data = av_realloc(pkt_data, pkt_size);
966.             zstream.avail_out = pkt_size - zstream.total_out;

libavformat/matroskadec.c:965:13: 
963.         do {
964.             pkt_size *= 3;
965.             pkt_data = av_realloc(pkt_data, pkt_size);
                 ^
966.             zstream.avail_out = pkt_size - zstream.total_out;
967.             zstream.next_out = pkt_data + zstream.total_out;

libavutil/mem.c:117:1: start of procedure av_realloc()
  115. }
  116. 
  117. void *av_realloc(void *ptr, size_t size)
       ^
  118. {
  119. #if CONFIG_MEMALIGN_HACK

libavutil/mem.c:124:8: Taking true branch
  122. 
  123.     /* let's disallow possible ambiguous cases */
  124.     if(size > (INT_MAX-16) )
              ^
  125.         return NULL;
  126. 

libavutil/mem.c:125:9: 
  123.     /* let's disallow possible ambiguous cases */
  124.     if(size > (INT_MAX-16) )
  125.         return NULL;
               ^
  126. 
  127. #if CONFIG_MEMALIGN_HACK

libavutil/mem.c:135:1: return from a call to av_realloc
  133.     return realloc(ptr, size);
  134. #endif
  135. }
       ^
  136. 
  137. void av_free(void *ptr)
