# HG changeset patch # User kostya # Date 1190604744 0 # Node ID cf77b8588f15a236036c5c47df430fceee7cf93a # Parent ec04964a1d1a31f05130cfb7c55e036a8adddd77 Do not try to decode more data than output buffer may hold diff -r ec04964a1d1a -r cf77b8588f15 adx.c --- a/adx.c Sun Sep 23 21:59:09 2007 +0000 +++ b/adx.c Mon Sep 24 03:32:24 2007 +0000 @@ -328,6 +328,11 @@ rest -= hdrsize; } + /* 18 bytes of data are expanded into 32*2 bytes of audio, + so guard against buffer overflows */ + if(rest/18 > *data_size/64) + rest = (*data_size/64) * 18; + if (c->in_temp) { int copysize = 18*avctx->channels - c->in_temp; memcpy(c->dec_temp+c->in_temp,buf,copysize);