mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2024-11-23 19:49:56 +00:00
Check output buffer size before decoding.
Originally committed as revision 15257 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
d636f0cc39
commit
42fe17a018
@ -235,6 +235,11 @@ static int mace3_decode_frame(AVCodecContext *avctx,
|
||||
MACEContext *ctx = avctx->priv_data;
|
||||
int i, j, k;
|
||||
|
||||
if (*data_size < 2 * 3 * buf_size) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Output buffer too small!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
for(i = 0; i < avctx->channels; i++) {
|
||||
int16_t *output = samples + i;
|
||||
|
||||
@ -266,6 +271,11 @@ static int mace6_decode_frame(AVCodecContext *avctx,
|
||||
MACEContext *ctx = avctx->priv_data;
|
||||
int i, j;
|
||||
|
||||
if (*data_size < 2 * 6 * buf_size) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Output buffer too small!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
for(i = 0; i < avctx->channels; i++) {
|
||||
int16_t *output = samples + i;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user