mpegaudiodec: check output data size based on avctx->frame_size
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
edf3c5a3eb
commit
4a66fe2107
@ -1801,8 +1801,8 @@ static int decode_frame(AVCodecContext * avctx,
|
|||||||
avctx->bit_rate = s->bit_rate;
|
avctx->bit_rate = s->bit_rate;
|
||||||
avctx->sub_id = s->layer;
|
avctx->sub_id = s->layer;
|
||||||
|
|
||||||
if(*data_size < 1152*avctx->channels*sizeof(OUT_INT))
|
if (*data_size < avctx->frame_size * avctx->channels * sizeof(OUT_INT))
|
||||||
return -1;
|
return AVERROR(EINVAL);
|
||||||
*data_size = 0;
|
*data_size = 0;
|
||||||
|
|
||||||
if(s->frame_size<=0 || s->frame_size > buf_size){
|
if(s->frame_size<=0 || s->frame_size > buf_size){
|
||||||
@ -1870,6 +1870,9 @@ static int decode_frame_adu(AVCodecContext * avctx,
|
|||||||
avctx->bit_rate = s->bit_rate;
|
avctx->bit_rate = s->bit_rate;
|
||||||
avctx->sub_id = s->layer;
|
avctx->sub_id = s->layer;
|
||||||
|
|
||||||
|
if (*data_size < avctx->frame_size * avctx->channels * sizeof(OUT_INT))
|
||||||
|
return AVERROR(EINVAL);
|
||||||
|
|
||||||
s->frame_size = len;
|
s->frame_size = len;
|
||||||
|
|
||||||
if (avctx->parse_only) {
|
if (avctx->parse_only) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user