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

libavformat/matroskadec.c:923:1: start of procedure matroska_decode_buffer()
921. }
922. 
923. static int matroska_decode_buffer(uint8_t** buf, int* buf_size,
     ^
924.                                   MatroskaTrack *track)
925. {

libavformat/matroskadec.c:926:5: 
924.                                   MatroskaTrack *track)
925. {
926.     MatroskaTrackEncoding *encodings = track->encodings.elem;
         ^
927.     uint8_t* data = *buf;
928.     int isize = *buf_size;

libavformat/matroskadec.c:927:5: 
925. {
926.     MatroskaTrackEncoding *encodings = track->encodings.elem;
927.     uint8_t* data = *buf;
         ^
928.     int isize = *buf_size;
929.     uint8_t* pkt_data = NULL;

libavformat/matroskadec.c:928:5: 
926.     MatroskaTrackEncoding *encodings = track->encodings.elem;
927.     uint8_t* data = *buf;
928.     int isize = *buf_size;
         ^
929.     uint8_t* pkt_data = NULL;
930.     int pkt_size = isize;

libavformat/matroskadec.c:929:5: 
927.     uint8_t* data = *buf;
928.     int isize = *buf_size;
929.     uint8_t* pkt_data = NULL;
         ^
930.     int pkt_size = isize;
931.     int result = 0;

libavformat/matroskadec.c:930:5: 
928.     int isize = *buf_size;
929.     uint8_t* pkt_data = NULL;
930.     int pkt_size = isize;
         ^
931.     int result = 0;
932.     int olen;

libavformat/matroskadec.c:931:5: 
929.     uint8_t* pkt_data = NULL;
930.     int pkt_size = isize;
931.     int result = 0;
         ^
932.     int olen;
933. 

libavformat/matroskadec.c:934:9: Taking false branch
932.     int olen;
933. 
934.     if (pkt_size >= 10000000)
             ^
935.         return -1;
936. 

libavformat/matroskadec.c:937:5: 
935.         return -1;
936. 
937.     switch (encodings[0].compression.algo) {
         ^
938.     case MATROSKA_TRACK_ENCODING_COMP_HEADERSTRIP:
939.         return encodings[0].compression.settings.size;

libavformat/matroskadec.c:938:5: Switch condition is false. Skipping switch case
936. 
937.     switch (encodings[0].compression.algo) {
938.     case MATROSKA_TRACK_ENCODING_COMP_HEADERSTRIP:
         ^
939.         return encodings[0].compression.settings.size;
940.     case MATROSKA_TRACK_ENCODING_COMP_LZO:

libavformat/matroskadec.c:940:5: Switch condition is false. Skipping switch case
938.     case MATROSKA_TRACK_ENCODING_COMP_HEADERSTRIP:
939.         return encodings[0].compression.settings.size;
940.     case MATROSKA_TRACK_ENCODING_COMP_LZO:
         ^
941.         do {
942.             olen = pkt_size *= 3;

libavformat/matroskadec.c:951:5: Switch condition is true. Entering switch case
949.         break;
950. #if CONFIG_ZLIB
951.     case MATROSKA_TRACK_ENCODING_COMP_ZLIB: {
         ^
952.         z_stream zstream = {0};
953.         if (inflateInit(&zstream) != Z_OK)

libavformat/matroskadec.c:952:9: 
950. #if CONFIG_ZLIB
951.     case MATROSKA_TRACK_ENCODING_COMP_ZLIB: {
952.         z_stream zstream = {0};
             ^
953.         if (inflateInit(&zstream) != Z_OK)
954.             return -1;

libavformat/matroskadec.c:953:13: Taking false branch
951.     case MATROSKA_TRACK_ENCODING_COMP_ZLIB: {
952.         z_stream zstream = {0};
953.         if (inflateInit(&zstream) != Z_OK)
                 ^
954.             return -1;
955.         zstream.next_in = data;

libavformat/matroskadec.c:955:9: 
953.         if (inflateInit(&zstream) != Z_OK)
954.             return -1;
955.         zstream.next_in = data;
             ^
956.         zstream.avail_in = isize;
957.         do {

libavformat/matroskadec.c:956:9: 
954.             return -1;
955.         zstream.next_in = data;
956.         zstream.avail_in = isize;
             ^
957.         do {
958.             pkt_size *= 3;

libavformat/matroskadec.c:958:13: 
956.         zstream.avail_in = isize;
957.         do {
958.             pkt_size *= 3;
                 ^
959.             pkt_data = av_realloc(pkt_data, pkt_size);
960.             zstream.avail_out = pkt_size - zstream.total_out;

libavformat/matroskadec.c:959:13: 
957.         do {
958.             pkt_size *= 3;
959.             pkt_data = av_realloc(pkt_data, pkt_size);
                 ^
960.             zstream.avail_out = pkt_size - zstream.total_out;
961.             zstream.next_out = pkt_data + zstream.total_out;

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

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

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

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

libavformat/matroskadec.c:960:13: 
958.             pkt_size *= 3;
959.             pkt_data = av_realloc(pkt_data, pkt_size);
960.             zstream.avail_out = pkt_size - zstream.total_out;
                 ^
961.             zstream.next_out = pkt_data + zstream.total_out;
962.             result = inflate(&zstream, Z_NO_FLUSH);

libavformat/matroskadec.c:961:13: 
959.             pkt_data = av_realloc(pkt_data, pkt_size);
960.             zstream.avail_out = pkt_size - zstream.total_out;
961.             zstream.next_out = pkt_data + zstream.total_out;
                 ^
962.             result = inflate(&zstream, Z_NO_FLUSH);
963.         } while (result==Z_OK && pkt_size<10000000);

libavformat/matroskadec.c:962:13: Skipping inflate(): method has no implementation
960.             zstream.avail_out = pkt_size - zstream.total_out;
961.             zstream.next_out = pkt_data + zstream.total_out;
962.             result = inflate(&zstream, Z_NO_FLUSH);
                 ^
963.         } while (result==Z_OK && pkt_size<10000000);
964.         pkt_size = zstream.total_out;

libavformat/matroskadec.c:963:18: Loop condition is true. Entering loop body
961.             zstream.next_out = pkt_data + zstream.total_out;
962.             result = inflate(&zstream, Z_NO_FLUSH);
963.         } while (result==Z_OK && pkt_size<10000000);
                      ^
964.         pkt_size = zstream.total_out;
965.         inflateEnd(&zstream);

libavformat/matroskadec.c:963:34: Loop condition is true. Entering loop body
961.             zstream.next_out = pkt_data + zstream.total_out;
962.             result = inflate(&zstream, Z_NO_FLUSH);
963.         } while (result==Z_OK && pkt_size<10000000);
                                      ^
964.         pkt_size = zstream.total_out;
965.         inflateEnd(&zstream);

libavformat/matroskadec.c:958:13: 
956.         zstream.avail_in = isize;
957.         do {
958.             pkt_size *= 3;
                 ^
959.             pkt_data = av_realloc(pkt_data, pkt_size);
960.             zstream.avail_out = pkt_size - zstream.total_out;

libavformat/matroskadec.c:959:13: 
957.         do {
958.             pkt_size *= 3;
959.             pkt_data = av_realloc(pkt_data, pkt_size);
                 ^
960.             zstream.avail_out = pkt_size - zstream.total_out;
961.             zstream.next_out = pkt_data + zstream.total_out;

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

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

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

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