[FFmpeg-devel] [PATCH 3/3] nutdec: fix various memleaks on failure

Andreas Cadhalpun andreas.cadhalpun at googlemail.com
Sat May 23 15:14:58 CEST 2015


On 23.05.2015 14:05, Michael Niedermayer wrote:
> On Sat, May 23, 2015 at 11:05:48AM +0200, Andreas Cadhalpun wrote:
>> 4cc0440459f6b5e2223aaf2b667e3f222908714d  0001-nutdec-fix-various-memleaks-on-failure.patch
>> From 60de9fa45698acd206dccfc6eb634a1e6a49889f Mon Sep 17 00:00:00 2001
>> From: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
>> Date: Fri, 22 May 2015 23:02:07 +0200
>> Subject: [PATCH] nutdec: fix various memleaks on failure
>>
>> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
>> ---
>>  libavformat/nutdec.c | 84 +++++++++++++++++++++++++++++++++++++---------------
>>  1 file changed, 60 insertions(+), 24 deletions(-)
>>
>> diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
>> index eeaf8bf..0757a70 100644
>> --- a/libavformat/nutdec.c
>> +++ b/libavformat/nutdec.c
>> @@ -203,7 +203,8 @@ static int nut_probe(AVProbeData *p)
>>          tmp = ffio_read_varlen(bc);                                           \
>>          if (!(check)) {                                                       \
>>              av_log(s, AV_LOG_ERROR, "Error " #dst " is (%"PRId64")\n", tmp);  \
>> -            return AVERROR_INVALIDDATA;                                       \
>> +            ret = AVERROR_INVALIDDATA;                                        \
>> +            goto fail;                                                        \
>>          }                                                                     \
>>          dst = tmp;                                                            \
>>      } while (0)
> 
> with this syncpoints and has_keyframes must be set to NULL in
> find_and_decode_index() otherwise the later free might be freeing
> a uninitialized pointer

You're right. Fixed patch attached.

Best regards,
Andreas

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-nutdec-fix-various-memleaks-on-failure.patch
Type: text/x-diff
Size: 9170 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150523/e7049430/attachment.bin>


More information about the ffmpeg-devel mailing list