aacdec: don't return frames without data
Since commit676a395a
aac->frame->data is not necessarily allocated at the end of aac_decode_frame_int if avctx->channels is 0. In this case a bogus frame without any data, but non-zero nb_samples is returned. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commitec38a1ba40
) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:

committed by
Michael Niedermayer

parent
254e3af60f
commit
7d45230d81
@@ -3059,6 +3059,12 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
|
|||||||
AV_WL32(side, 2*AV_RL32(side));
|
AV_WL32(side, 2*AV_RL32(side));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!ac->frame->data[0] && samples) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "no frame data found\n");
|
||||||
|
err = AVERROR_INVALIDDATA;
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
*got_frame_ptr = !!samples;
|
*got_frame_ptr = !!samples;
|
||||||
if (samples) {
|
if (samples) {
|
||||||
ac->frame->nb_samples = samples;
|
ac->frame->nb_samples = samples;
|
||||||
|
Reference in New Issue
Block a user