diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-06-15 01:28:40 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-06-15 01:28:40 +0200 |
commit | 08169fc3d2038af4d3b47cc0a9d7d731b5619877 (patch) | |
tree | 01bbaa4a9d79bf94a88eda4fba5c97260a87a87c /libavformat | |
parent | 88a740afde048f1c5ce3795a1136e0d6c9d2f289 (diff) | |
download | ffmpeg-08169fc3d2038af4d3b47cc0a9d7d731b5619877.tar.gz |
matroskadec: move lace_size check up so it catches all code pathes
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/matroskadec.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index f38cee736b..77d9636334 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -1975,6 +1975,11 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data, if (res == 0) { for (n = 0; n < laces; n++) { + if (lace_size[n] > size) { + av_log(matroska->ctx, AV_LOG_ERROR, "Invalid packet size\n"); + break; + } + if ((st->codec->codec_id == CODEC_ID_RA_288 || st->codec->codec_id == CODEC_ID_COOK || st->codec->codec_id == CODEC_ID_SIPR || @@ -2044,11 +2049,6 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data, uint32_t pkt_size = lace_size[n]; uint8_t *pkt_data = data; - if (pkt_size > size) { - av_log(matroska->ctx, AV_LOG_ERROR, "Invalid packet size\n"); - break; - } - if (encodings && encodings->scope & 1) { offset = matroska_decode_buffer(&pkt_data,&pkt_size, track); if (offset < 0) |