On 10/28/2011 02:45 PM, Kostya Shishkov wrote:

> On Fri, Oct 28, 2011 at 01:32:34PM -0400, Justin Ruggles wrote:
>> ---
>>  libavcodec/atrac1.c |   11 ++++++++---
>>  1 files changed, 8 insertions(+), 3 deletions(-)
>>
>> diff --git a/libavcodec/atrac1.c b/libavcodec/atrac1.c
>> index c646ba9..043fad3 100644
>> --- a/libavcodec/atrac1.c
>> +++ b/libavcodec/atrac1.c
>> @@ -329,6 +329,7 @@ static int atrac1_decode_frame(AVCodecContext *avctx, 
>> void *data,
>>  static av_cold int atrac1_decode_init(AVCodecContext *avctx)
>>  {
>>      AT1Ctx *q = avctx->priv_data;
>> +    int ret;
>>  
>>      avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
>>  
>> @@ -349,9 +350,13 @@ static av_cold int atrac1_decode_init(AVCodecContext 
>> *avctx)
>>      }
>>  
>>      /* Init the mdct transforms */
>> -    ff_mdct_init(&q->mdct_ctx[0], 6, 1, -1.0/ (1 << 15));
>> -    ff_mdct_init(&q->mdct_ctx[1], 8, 1, -1.0/ (1 << 15));
>> -    ff_mdct_init(&q->mdct_ctx[2], 9, 1, -1.0/ (1 << 15));
>> +    if ((ret = ff_mdct_init(&q->mdct_ctx[0], 6, 1, -1.0/ (1 << 15))) ||
>> +        (ret = ff_mdct_init(&q->mdct_ctx[1], 8, 1, -1.0/ (1 << 15))) ||
>> +        (ret = ff_mdct_init(&q->mdct_ctx[2], 9, 1, -1.0/ (1 << 15)))) {
>> +        av_log(avctx, AV_LOG_ERROR, "Error initializing MDCT\n");
>> +        av_freep(&q->out_samples[0]);
>> +        return ret;
>> +    }
>>  
>>      ff_init_ff_sine_windows(5);
>>  
>> -- 
> 
> isn't uniniting mdct contexts also required here?


oops. you're right. i'll redo the patch.

-Justin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to