From 4a9628f276a883949f361058b4a7a20477276da0 Mon Sep 17 00:00:00 2001 From: Dustin Brody Date: Thu, 8 Sep 2011 18:43:32 -0400 Subject: [PATCH 1/3] matroskadec: bail on parsing of incorrect seek index segments Signed-off-by: Anton Khirnov --- libavformat/matroskadec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 037997742c..8402967da3 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -1148,7 +1148,7 @@ static int matroska_parse_seekhead_entry(MatroskaDemuxContext *matroska, int idx matroska->num_levels++; matroska->current_id = 0; - ebml_parse(matroska, matroska_segment, matroska); + ret = ebml_parse(matroska, matroska_segment, matroska); /* remove dummy level */ while (matroska->num_levels) { From d7d2f0e63c8187d531168256a0ce2aac21d5fce6 Mon Sep 17 00:00:00 2001 From: Dustin Brody Date: Thu, 15 Sep 2011 09:34:38 +0200 Subject: [PATCH 2/3] matroskadec: fix typo. Signed-off-by: Anton Khirnov --- libavformat/matroskadec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 8402967da3..01c9a7b3ce 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -1332,7 +1332,7 @@ static int matroska_read_header(AVFormatContext *s, AVFormatParameters *ap) } if (encodings_list->nb_elem > 1) { av_log(matroska->ctx, AV_LOG_ERROR, - "Multiple combined encodings no supported"); + "Multiple combined encodings not supported"); } else if (encodings_list->nb_elem == 1) { if (encodings[0].type || (encodings[0].compression.algo != MATROSKA_TRACK_ENCODING_COMP_HEADERSTRIP && From ea540401d6082474df8364169e2041e29e4dc407 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Thu, 15 Sep 2011 07:30:34 -0700 Subject: [PATCH 3/3] swscale: fix byte overreads in SSE-optimized hscale(). SSE-optimized hScale() scales up to 4 pixels at once, so we need to allocate up to 3 padding pixels to prevent overreads. This fixes valgrind errors in various swscale-tests on fate. --- libswscale/utils.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/libswscale/utils.c b/libswscale/utils.c index 2b52199a35..409657462e 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -184,8 +184,8 @@ static int initFilter(int16_t **outFilter, int16_t **filterPos, int *outFilterSi emms_c(); //FIXME this should not be required but it IS (even for non-MMX versions) - // NOTE: the +1 is for the MMX scaler which reads over the end - FF_ALLOC_OR_GOTO(NULL, *filterPos, (dstW+1)*sizeof(int16_t), fail); + // NOTE: the +3 is for the MMX(+1)/SSE(+3) scaler which reads over the end + FF_ALLOC_OR_GOTO(NULL, *filterPos, (dstW+3)*sizeof(int16_t), fail); if (FFABS(xInc - 0x10000) <10) { // unscaled int i; @@ -471,7 +471,7 @@ static int initFilter(int16_t **outFilter, int16_t **filterPos, int *outFilterSi // Note the +1 is for the MMX scaler which reads over the end /* align at 16 for AltiVec (needed by hScale_altivec_real) */ - FF_ALLOCZ_OR_GOTO(NULL, *outFilter, *outFilterSize*(dstW+1)*sizeof(int16_t), fail); + FF_ALLOCZ_OR_GOTO(NULL, *outFilter, *outFilterSize*(dstW+3)*sizeof(int16_t), fail); /* normalize & store in outFilter */ for (i=0; i