summaryrefslogtreecommitdiff
path: root/libavcodec/dsicinav.c
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2007-09-22 09:09:47 +0000
committerKostya Shishkov <kostya.shishkov@gmail.com>2007-09-22 09:09:47 +0000
commit675a0583b42f7eeac145dd0adf6d66d87c2af892 (patch)
tree35e72a4f6e770c54545baa8f15f0034e2fd9da31 /libavcodec/dsicinav.c
parentee9d77dde68c8b30aa33ec3122bed857012ba6fa (diff)
Do not decode more data than output buffer may hold
Originally committed as revision 10547 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/dsicinav.c')
-rw-r--r--libavcodec/dsicinav.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/dsicinav.c b/libavcodec/dsicinav.c
index ecaa94e4d0..f593a59d70 100644
--- a/libavcodec/dsicinav.c
+++ b/libavcodec/dsicinav.c
@@ -317,6 +317,8 @@ static int cinaudio_decode_frame(AVCodecContext *avctx,
uint8_t *src = buf;
int16_t *samples = (int16_t *)data;
+ buf_size = FFMIN(buf_size, *data_size/2);
+
if (cin->initial_decode_frame) {
cin->initial_decode_frame = 0;
cin->delta = (int16_t)AV_RL16(src); src += 2;