aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-01-12 16:37:42 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-01-12 16:37:42 +0100
commit1203e92181b4c4af4ba1aa0edc1da3ae8447f9b4 (patch)
treeed47a7289f23930c320d3d9b4e6b6996cf6eff29
parentc693ccb89a9ed81b90901d958f8e72a7179c7242 (diff)
parent0358a099f8abe60230dc2e5bec59bfceb7d1be07 (diff)
downloadffmpeg-1203e92181b4c4af4ba1aa0edc1da3ae8447f9b4.tar.gz
Merge commit '0358a099f8abe60230dc2e5bec59bfceb7d1be07' into release/1.1
* commit '0358a099f8abe60230dc2e5bec59bfceb7d1be07': indeo4: Check the block size if reusing the band configuration ffv1: Assume bitdepth 0 means 8bit alsa-audio-dec: explicitly cast the delay to a signed int64 matroskadec: pad EBML_BIN data. motionpixels: clip VLC codes. avidec: fix a memleak in the dv init code. Conflicts: libavcodec/ffv1dec.c libavcodec/indeo4.c libavdevice/alsa-audio-dec.c libavformat/matroskadec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/indeo4.c8
-rw-r--r--libavcodec/motionpixels.c1
2 files changed, 9 insertions, 0 deletions
diff --git a/libavcodec/indeo4.c b/libavcodec/indeo4.c
index a33caa084f..8a2bcb3aa3 100644
--- a/libavcodec/indeo4.c
+++ b/libavcodec/indeo4.c
@@ -296,6 +296,7 @@ static int decode_band_hdr(IVI45DecContext *ctx, IVIBandDesc *band,
band->is_empty = get_bits1(&ctx->gb);
if (!band->is_empty) {
+ int old_blk_size = band->blk_size;
/* skip header size
* If header size is not given, header size is 4 bytes. */
if (get_bits1(&ctx->gb))
@@ -391,6 +392,13 @@ static int decode_band_hdr(IVI45DecContext *ctx, IVIBandDesc *band,
return AVERROR_INVALIDDATA;
}
band->quant_mat = quant_mat;
+ } else {
+ if (old_blk_size != band->blk_size) {
+ av_log(avctx, AV_LOG_ERROR,
+ "The band block size does not match the configuration "
+ "inherited\n");
+ return AVERROR_INVALIDDATA;
+ }
}
if (quant_index_to_tab[band->quant_mat] > 4 && band->blk_size == 4) {
av_log(avctx, AV_LOG_ERROR, "Invalid quant matrix for 4x4 block encountered!\n");
diff --git a/libavcodec/motionpixels.c b/libavcodec/motionpixels.c
index 61a718c5a9..fbfdd9db32 100644
--- a/libavcodec/motionpixels.c
+++ b/libavcodec/motionpixels.c
@@ -165,6 +165,7 @@ static int mp_get_vlc(MotionPixelsContext *mp, GetBitContext *gb)
int i;
i = (mp->codes_count == 1) ? 0 : get_vlc2(gb, mp->vlc.table, mp->max_codes_bits, 1);
+ i = FFMIN(i, FF_ARRAY_ELEMS(mp->codes) - 1);
return mp->codes[i].delta;
}