[FFmpeg-devel] [PATCH 3/3] nutdec: fix memleaks on error in nut_read_header

Andreas Cadhalpun andreas.cadhalpun at googlemail.com
Tue Apr 28 22:59:29 CEST 2015


On 28.04.2015 22:55, Michael Niedermayer wrote:
> On Tue, Apr 28, 2015 at 08:58:21PM +0200, Andreas Cadhalpun wrote:
>> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
> [...]
>> @@ -806,7 +811,10 @@ static int nut_read_header(AVFormatContext *s)
>>  
>>      ff_metadata_conv_ctx(s, NULL, ff_nut_metadata_conv);
>>  
>> -    return 0;
>> +end:
>> +    if (ret < 0)
>> +        nut_read_close(s);
> 
>> +    return FFMIN(ret, 0);
> 
> btw, the FFMIN could be removed unless iam missing something
> not really important though

Yes, I just wanted to make it future proof.

Best regards,
Andreas



More information about the ffmpeg-devel mailing list