changeset 5696:914ff70e1367 libavcodec

Do not decode more data than output buffer may hold
author kostya
date Sat, 22 Sep 2007 09:09:47 +0000
parents 6b8daf48b82f
children a3fec73667af
files dsicinav.c
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/dsicinav.c	Fri Sep 21 18:23:46 2007 +0000
+++ b/dsicinav.c	Sat Sep 22 09:09:47 2007 +0000
@@ -317,6 +317,8 @@
     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;