summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-04-17 17:12:22 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-04-17 17:58:19 +0200
commit2677697ac93a5de731aac598e863bd8bbe3b3a53 (patch)
tree7f8af382dffdfb36988bf86d1f3ee21764182cc2 /libavformat
parenta80217a5eec821fa9027eaf59ace95187843d320 (diff)
matroskadec: check headerstrip data availability.
Fixes null ptr dereference Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/matroskadec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index a484c50949..6d2d43e738 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1011,6 +1011,10 @@ static int matroska_decode_buffer(uint8_t** buf, int* buf_size,
switch (encodings[0].compression.algo) {
case MATROSKA_TRACK_ENCODING_COMP_HEADERSTRIP:
+ if (encodings[0].compression.settings.size && !encodings[0].compression.settings.data) {
+ av_log(0, AV_LOG_ERROR, "Compression size but no data in headerstrip\n");
+ return -1;
+ }
return encodings[0].compression.settings.size;
case MATROSKA_TRACK_ENCODING_COMP_LZO:
do {