mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-13 21:28:01 +02:00
Check that we have enough output space available.
Originally committed as revision 14170 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
0261e3651a
commit
362aba4be7
@ -781,6 +781,11 @@ static int wma_decode_superframe(AVCodecContext *avctx,
|
|||||||
skip_bits(&s->gb, 4); /* super frame index */
|
skip_bits(&s->gb, 4); /* super frame index */
|
||||||
nb_frames = get_bits(&s->gb, 4) - 1;
|
nb_frames = get_bits(&s->gb, 4) - 1;
|
||||||
|
|
||||||
|
if((nb_frames+1) * s->nb_channels * s->frame_len * sizeof(int16_t) > *data_size){
|
||||||
|
av_log(s->avctx, AV_LOG_ERROR, "Insufficient output space\n");
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
bit_offset = get_bits(&s->gb, s->byte_offset_bits + 3);
|
bit_offset = get_bits(&s->gb, s->byte_offset_bits + 3);
|
||||||
|
|
||||||
if (s->last_superframe_len > 0) {
|
if (s->last_superframe_len > 0) {
|
||||||
@ -836,6 +841,10 @@ static int wma_decode_superframe(AVCodecContext *avctx,
|
|||||||
s->last_superframe_len = len;
|
s->last_superframe_len = len;
|
||||||
memcpy(s->last_superframe, buf + pos, len);
|
memcpy(s->last_superframe, buf + pos, len);
|
||||||
} else {
|
} else {
|
||||||
|
if(s->nb_channels * s->frame_len * sizeof(int16_t) > *data_size){
|
||||||
|
av_log(s->avctx, AV_LOG_ERROR, "Insufficient output space\n");
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
/* single frame decode */
|
/* single frame decode */
|
||||||
if (wma_decode_frame(s, samples) < 0)
|
if (wma_decode_frame(s, samples) < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
Loading…
Reference in New Issue
Block a user