diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-08-26 14:46:56 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-08-26 14:47:15 +0200 |
commit | 6063f012f2f1c5c54ad518330d1d8cceba68d855 (patch) | |
tree | 5133427c8c0e564034972be5416a3eef1f65f0d1 /libavcodec/twinvq.c | |
parent | e43c672b568e195a01e8748db096eff715eb7b5f (diff) | |
parent | 9e7b62f0fb7462a902330fcc82cf596388f0187b (diff) | |
download | ffmpeg-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/twinvq.c')
-rw-r--r-- | libavcodec/twinvq.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libavcodec/twinvq.c b/libavcodec/twinvq.c index 7c4f4997a2..00b423d56d 100644 --- a/libavcodec/twinvq.c +++ b/libavcodec/twinvq.c @@ -489,6 +489,12 @@ int ff_twinvq_decode_frame(AVCodecContext *avctx, void *data, out = (float **)frame->extended_data; } + if (buf_size < avctx->block_align) { + av_log(avctx, AV_LOG_ERROR, + "Frame too small (%d bytes). Truncated file?\n", buf_size); + return AVERROR(EINVAL); + } + if ((ret = tctx->read_bitstream(avctx, tctx, buf, buf_size)) < 0) return ret; @@ -506,7 +512,7 @@ int ff_twinvq_decode_frame(AVCodecContext *avctx, void *data, *got_frame_ptr = 1; - return buf_size; + return avctx->block_align; } /** |