diff options
author | Luca Barbato | 2012-09-14 18:39:58 +0200 |
---|---|---|
committer | Luca Barbato | 2012-09-19 20:34:13 +0200 |
commit | 581281e242609a222233a2e5538b89dfb88fb18e (patch) | |
tree | 6d3808a45041c91bbec44f320b0cce06139922ec /libavformat | |
parent | cd4739c4f2d7ed56405f40dffe6254f6275e6e41 (diff) |
matroskadec: check realloc in lzo encoding
Make all the compression encodings behave the same way.
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/matroskadec.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 95130fc4df..bb505c27ab 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -999,7 +999,11 @@ static int matroska_decode_buffer(uint8_t** buf, int* buf_size, case MATROSKA_TRACK_ENCODING_COMP_LZO: do { olen = pkt_size *= 3; - pkt_data = av_realloc(pkt_data, pkt_size+AV_LZO_OUTPUT_PADDING); + newpktdata = av_realloc(pkt_data, pkt_size + AV_LZO_OUTPUT_PADDING); + if (!newpktdata) { + goto failed; + } + pkt_data = newpktdata; result = av_lzo1x_decode(pkt_data, &olen, data, &isize); } while (result==AV_LZO_OUTPUT_FULL && pkt_size<10000000); if (result) |