changeset 11546:1d81cd330928 libavcodec

TTA : Check if the output buffer size is within bounds. Fixes issue 1848.
author jai_menon
date Sun, 28 Mar 2010 17:17:48 +0000
parents c7084c69abcc
children aba20ba60384
files tta.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tta.c	Sat Mar 27 13:22:07 2010 +0000
+++ b/tta.c	Sun Mar 28 17:17:48 2010 +0000
@@ -302,6 +302,10 @@
         int cur_chan = 0, framelen = s->frame_length;
         int32_t *p;
 
+        if (*data_size < (framelen * s->channels * 2)) {
+            av_log(avctx, AV_LOG_ERROR,"Output buffer size is too small.\n");
+            return -1;
+        }
         // FIXME: seeking
         s->total_frames--;
         if (!s->total_frames && s->last_frame_length)