[FFmpeg-devel] [PATCH] AAC: give an error message when returning due to an unallocated channel element

Robert Swain robert.swain
Thu Feb 12 15:12:39 CET 2009


2009/2/12 M?ns Rullg?rd <mans at mansr.com>:
> Robert Swain <robert.swain at gmail.com> writes:
>
>> 2009/2/12 Baptiste Coudurier <baptiste.coudurier at gmail.com>:
>>> Hi,
>>>
>>> Alex Converse wrote:
>>>> I've run into this a few times. It's worth a message.
>>>>
>>>> Regards,
>>>> Alex Converse
>>>>
>>>>
>>>> ------------------------------------------------------------------------
>>>>
>>>> diff --git a/libavcodec/aac.c b/libavcodec/aac.c
>>>> index 7275430..64c2ae6 100644
>>>> --- a/libavcodec/aac.c
>>>> +++ b/libavcodec/aac.c
>>>> @@ -1576,7 +1576,10 @@ static int aac_decode_frame(AVCodecContext * avccontext, void * data, int * data
>>>>          }
>>>>          if(elem_type < TYPE_DSE) {
>>>>              if(!ac->che[elem_type][elem_id])
>>>> +            {
>>>> +                av_log(ac->avccontext, AV_LOG_ERROR, "channel element %d.%d is unallocated\n", elem_type, elem_id);
>>>>                  return -1;
>>>> +            }
>>>>              if(elem_type != TYPE_CCE)
>>>>                  ac->che[elem_type][elem_id]->coup.coupling_point = 4;
>>>>          }
>>>>
>>>
>>> Braces are misplaced. Should be "if () {"
>>
>> It's consistent with the surrounding code. I'll go through and change
>> them to "if () {" instead of "if() {" at some point.
>
> It's not consistent with the code two lines up...

The '{' wasn't but the spacing was. I guess you're right, the comment
was referring to that. Well, it's OK now anyway.

Regards,
Rob




More information about the ffmpeg-devel mailing list