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

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

libavformat/matroskadec.c:980:5: 
978.                                   MatroskaTrack *track)
979. {
980.     MatroskaTrackEncoding *encodings = track->encodings.elem;
         ^
981.     uint8_t* data = *buf;
982.     int isize = *buf_size;

libavformat/matroskadec.c:981:5: 
979. {
980.     MatroskaTrackEncoding *encodings = track->encodings.elem;
981.     uint8_t* data = *buf;
         ^
982.     int isize = *buf_size;
983.     uint8_t* pkt_data = NULL;

libavformat/matroskadec.c:982:5: 
980.     MatroskaTrackEncoding *encodings = track->encodings.elem;
981.     uint8_t* data = *buf;
982.     int isize = *buf_size;
         ^
983.     uint8_t* pkt_data = NULL;
984.     uint8_t av_unused *newpktdata;

libavformat/matroskadec.c:983:5: 
981.     uint8_t* data = *buf;
982.     int isize = *buf_size;
983.     uint8_t* pkt_data = NULL;
         ^
984.     uint8_t av_unused *newpktdata;
985.     int pkt_size = isize;

libavformat/matroskadec.c:985:5: 
983.     uint8_t* pkt_data = NULL;
984.     uint8_t av_unused *newpktdata;
985.     int pkt_size = isize;
         ^
986.     int result = 0;
987.     int olen;

libavformat/matroskadec.c:986:5: 
984.     uint8_t av_unused *newpktdata;
985.     int pkt_size = isize;
986.     int result = 0;
         ^
987.     int olen;
988. 

libavformat/matroskadec.c:989:9: Taking false branch
987.     int olen;
988. 
989.     if (pkt_size >= 10000000)
             ^
990.         return -1;
991. 

libavformat/matroskadec.c:992:5: 
990.         return -1;
991. 
992.     switch (encodings[0].compression.algo) {
         ^
993.     case MATROSKA_TRACK_ENCODING_COMP_HEADERSTRIP:
994.         return encodings[0].compression.settings.size;

libavformat/matroskadec.c:993:5: Switch condition is false. Skipping switch case
991. 
992.     switch (encodings[0].compression.algo) {
993.     case MATROSKA_TRACK_ENCODING_COMP_HEADERSTRIP:
         ^
994.         return encodings[0].compression.settings.size;
995.     case MATROSKA_TRACK_ENCODING_COMP_LZO:

libavformat/matroskadec.c:995:5: Switch condition is true. Entering switch case
993.     case MATROSKA_TRACK_ENCODING_COMP_HEADERSTRIP:
994.         return encodings[0].compression.settings.size;
995.     case MATROSKA_TRACK_ENCODING_COMP_LZO:
         ^
996.         do {
997.             olen = pkt_size *= 3;

libavformat/matroskadec.c:997:13: 
995.     case MATROSKA_TRACK_ENCODING_COMP_LZO:
996.         do {
997.             olen = pkt_size *= 3;
                 ^
998.             pkt_data = av_realloc(pkt_data, pkt_size+AV_LZO_OUTPUT_PADDING);
999.             result = av_lzo1x_decode(pkt_data, &olen, data, &isize);

libavformat/matroskadec.c:998:13: 
 996.         do {
 997.             olen = pkt_size *= 3;
 998.             pkt_data = av_realloc(pkt_data, pkt_size+AV_LZO_OUTPUT_PADDING);
                  ^
 999.             result = av_lzo1x_decode(pkt_data, &olen, data, &isize);
1000.         } while (result==AV_LZO_OUTPUT_FULL && pkt_size<10000000);

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

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

libavutil/mem.c:139:5: 
  137.     return _aligned_realloc(ptr, size, 32);
  138. #else
  139.     return realloc(ptr, size);
           ^
  140. #endif
  141. }

libavutil/mem.c:141:1: return from a call to av_realloc
  139.     return realloc(ptr, size);
  140. #endif
  141. }
       ^
  142. 
  143. void av_free(void *ptr)

libavformat/matroskadec.c:999:13: Skipping av_lzo1x_decode(): empty list of specs
 997.             olen = pkt_size *= 3;
 998.             pkt_data = av_realloc(pkt_data, pkt_size+AV_LZO_OUTPUT_PADDING);
 999.             result = av_lzo1x_decode(pkt_data, &olen, data, &isize);
                  ^
1000.         } while (result==AV_LZO_OUTPUT_FULL && pkt_size<10000000);
1001.         if (result)

libavformat/matroskadec.c:1000:18: Loop condition is true. Entering loop body
 998.             pkt_data = av_realloc(pkt_data, pkt_size+AV_LZO_OUTPUT_PADDING);
 999.             result = av_lzo1x_decode(pkt_data, &olen, data, &isize);
1000.         } while (result==AV_LZO_OUTPUT_FULL && pkt_size<10000000);
                       ^
1001.         if (result)
1002.             goto failed;

libavformat/matroskadec.c:1000:48: Loop condition is true. Entering loop body
 998.             pkt_data = av_realloc(pkt_data, pkt_size+AV_LZO_OUTPUT_PADDING);
 999.             result = av_lzo1x_decode(pkt_data, &olen, data, &isize);
1000.         } while (result==AV_LZO_OUTPUT_FULL && pkt_size<10000000);
                                                     ^
1001.         if (result)
1002.             goto failed;

libavformat/matroskadec.c:997:13: 
995.     case MATROSKA_TRACK_ENCODING_COMP_LZO:
996.         do {
997.             olen = pkt_size *= 3;
                 ^
998.             pkt_data = av_realloc(pkt_data, pkt_size+AV_LZO_OUTPUT_PADDING);
999.             result = av_lzo1x_decode(pkt_data, &olen, data, &isize);

libavformat/matroskadec.c:998:13: 
 996.         do {
 997.             olen = pkt_size *= 3;
 998.             pkt_data = av_realloc(pkt_data, pkt_size+AV_LZO_OUTPUT_PADDING);
                  ^
 999.             result = av_lzo1x_decode(pkt_data, &olen, data, &isize);
1000.         } while (result==AV_LZO_OUTPUT_FULL && pkt_size<10000000);

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

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

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

libavutil/mem.c:141:1: return from a call to av_realloc
  139.     return realloc(ptr, size);
  140. #endif
  141. }
       ^
  142. 
  143. void av_free(void *ptr)
