Commit e2e6c879 authored by Justin Ruggles's avatar Justin Ruggles

mpegaudiodec: check output data size based on avctx->frame_size

parent 512557b2
......@@ -1795,7 +1795,7 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *data_size,
avctx->bit_rate = s->bit_rate;
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 AVERROR(EINVAL);
*data_size = 0;
......@@ -1871,6 +1871,9 @@ static int decode_frame_adu(AVCodecContext *avctx, void *data, int *data_size,
avctx->bit_rate = s->bit_rate;
avctx->sub_id = s->layer;
if (*data_size < avctx->frame_size * avctx->channels * sizeof(OUT_INT))
return AVERROR(EINVAL);
s->frame_size = len;
#if FF_API_PARSE_FRAME
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment