aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/twinvqdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-08-26 14:46:56 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-08-26 14:47:15 +0200
commit6063f012f2f1c5c54ad518330d1d8cceba68d855 (patch)
tree5133427c8c0e564034972be5416a3eef1f65f0d1 /libavcodec/twinvqdec.c
parente43c672b568e195a01e8748db096eff715eb7b5f (diff)
parent9e7b62f0fb7462a902330fcc82cf596388f0187b (diff)
downloadffmpeg-6063f012f2f1c5c54ad518330d1d8cceba68d855.tar.gz
Merge commit '9e7b62f0fb7462a902330fcc82cf596388f0187b'
* commit '9e7b62f0fb7462a902330fcc82cf596388f0187b': twinvq: set block align for codecs and use it in size checks Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/twinvqdec.c')
-rw-r--r--libavcodec/twinvqdec.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/libavcodec/twinvqdec.c b/libavcodec/twinvqdec.c
index 05a814bfbc..1445733f83 100644
--- a/libavcodec/twinvqdec.c
+++ b/libavcodec/twinvqdec.c
@@ -258,12 +258,6 @@ static int twinvq_read_bitstream(AVCodecContext *avctx, TwinVQContext *tctx,
GetBitContext gb;
int i, j, k;
- if (buf_size * 8 < avctx->bit_rate * mtab->size / avctx->sample_rate + 8) {
- av_log(avctx, AV_LOG_ERROR,
- "Frame too small (%d bytes). Truncated file?\n", buf_size);
- return AVERROR(EINVAL);
- }
-
init_get_bits(&gb, buf, buf_size * 8);
skip_bits(&gb, get_bits(&gb, 8));
@@ -403,6 +397,9 @@ static av_cold int twinvq_decode_init(AVCodecContext *avctx)
return -1;
}
+ avctx->block_align = (avctx->bit_rate * tctx->mtab->size
+ / avctx->sample_rate + 15) / 8;
+
tctx->codec = TWINVQ_CODEC_VQF;
tctx->read_bitstream = twinvq_read_bitstream;
tctx->dec_bark_env = dec_bark_env;