diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-09-20 05:20:29 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-09-20 05:20:29 +0400 |
commit | 61ced71d79ebef22f8ab6ee3511a7a989f6fd3ac (patch) | |
tree | 6000ca917b87276d4e29b6ff5ca4fb7d0fee5b30 /libavformat | |
parent | d57ca5e5a8ba993630c87fbc87ed1f8267309278 (diff) | |
parent | 581281e242609a222233a2e5538b89dfb88fb18e (diff) |
Merge commit '581281e242609a222233a2e5538b89dfb88fb18e'
* commit '581281e242609a222233a2e5538b89dfb88fb18e':
matroskadec: check realloc in lzo encoding
matroska: honor error_recognition on unknown doctypes
tiffdec: Add support for GRAY16LE.
tiffenc: Add support for little endian RGB48 and GRAY16
mpeg4: support frame parameter changes with frame-mt
mpegvideo: check ff_find_unused_picture() return value for errors
mpegvideo: release frame buffers before freeing them
configure: msvc: default to 'lib' as 'ar' tool
build: support some non-standard ar variants
Conflicts:
libavcodec/h263dec.c
libavcodec/mpegvideo.c
libavcodec/tiff.c
libavcodec/tiffenc.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/matroskadec.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index e6ade11cea..48b2d9ba57 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -1065,7 +1065,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) @@ -1443,6 +1447,10 @@ static int matroska_read_header(AVFormatContext *s) break; if (i >= FF_ARRAY_ELEMS(matroska_doctypes)) { av_log(s, AV_LOG_WARNING, "Unknown EBML doctype '%s'\n", ebml.doctype); + if (matroska->ctx->error_recognition & AV_EF_EXPLODE) { + ebml_free(ebml_syntax, &ebml); + return AVERROR_INVALIDDATA; + } } ebml_free(ebml_syntax, &ebml); |