On 21/11/14 13:57, Vittorio Giovara wrote: > Also move the check in the case it is actually used. > > CC: libav-sta...@libav.org > Bug-Id: CID 1087090 > --- > libavcodec/aacdec.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c > index 6968102..9c0a46d 100644 > --- a/libavcodec/aacdec.c > +++ b/libavcodec/aacdec.c > @@ -143,8 +143,6 @@ static av_cold int che_configure(AACContext *ac, > enum ChannelPosition che_pos, > int type, int id, int *channels) > { > - if (*channels >= MAX_CHANNELS) > - return AVERROR_INVALIDDATA; > if (che_pos) { > if (!ac->che[type][id]) { > if (!(ac->che[type][id] = av_mallocz(sizeof(ChannelElement)))) > @@ -152,6 +150,8 @@ static av_cold int che_configure(AACContext *ac, > ff_aac_sbr_ctx_init(ac, &ac->che[type][id]->sbr); > } > if (type != TYPE_CCE) { > + if (*channels >= MAX_CHANNELS - 2) > + return AVERROR_INVALIDDATA; > ac->output_element[(*channels)++] = &ac->che[type][id]->ch[0]; > if (type == TYPE_CPE || > (type == TYPE_SCE && ac->oc[1].m4ac.ps == 1)) { > Ok. _______________________________________________ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
- [libav-devel] [PATCH 01/10] vc1: fix bad shift operations Vittorio Giovara
- Re: [libav-devel] [PATCH 01/10] vc1: fix bad shift o... Luca Barbato
- Re: [libav-devel] [PATCH 01/10] vc1: fix bad shi... Vittorio Giovara
- Re: [libav-devel] [PATCH 01/10] vc1: fix bad shift o... Luca Barbato
- [libav-devel] [PATCH 1/3] vc1: Simplify a little set... Luca Barbato
- [libav-devel] [PATCH 2/3] vc1: Set the is_intra ... Luca Barbato
- [libav-devel] [PATCH 3/3] vc1: Use the correct s... Luca Barbato
- Re: [libav-devel] [PATCH 1/3] vc1: Simplify a li... Vittorio Giovara
- [libav-devel] [PATCH 07/10] aacdec: avoid an out-of-bound... Vittorio Giovara
- Re: [libav-devel] [PATCH 07/10] aacdec: avoid an out... Luca Barbato
- [libav-devel] [PATCH 04/10] aacsbr: always initialize max... Vittorio Giovara
- [libav-devel] [PATCH 05/10] prores: Evaluate all the quan... Vittorio Giovara
- Re: [libav-devel] [PATCH 05/10] prores: Evaluate all... Vittorio Giovara
- [libav-devel] [PATCH 10/10] lavu: move internal define to... Vittorio Giovara
- [libav-devel] [PATCH 03/10] aac: Simplify decode_mid_side... Vittorio Giovara
- Re: [libav-devel] [PATCH 03/10] aac: Simplify decode... Vittorio Giovara
- Re: [libav-devel] [PATCH 03/10] aac: Simplify de... Justin Ruggles
- [libav-devel] [PATCH 08/10] motion_est: x86: convert stri... Vittorio Giovara