[FFmpeg-devel] [PATCH 2/3] nutdec: check chapter creation in decode_info_header

Andreas Cadhalpun andreas.cadhalpun at googlemail.com
Tue Apr 28 22:41:01 CEST 2015


On 28.04.2015 22:33, Michael Niedermayer wrote:
> On Tue, Apr 28, 2015 at 08:57:59PM +0200, Andreas Cadhalpun wrote:
>> This fixes a segmentation fault when accessing the metadata.
>>
>> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
>> ---
>>  libavformat/nutdec.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
>> index 46946d3..2049f70 100644
>> --- a/libavformat/nutdec.c
>> +++ b/libavformat/nutdec.c
>> @@ -505,6 +505,10 @@ static int decode_info_header(NUTContext *nut)
>>                                       nut->time_base[chapter_start %
>>                                                      nut->time_base_count],
>>                                       start, start + chapter_len, NULL);
>> +        if (!chapter) {
>> +            av_log(s, AV_LOG_ERROR, "could not create chapter\n");
>> +            return AVERROR_ENOMEM;

This should of course be AVERROR(ENOMEM).
(I had there AVERROR_INVALIDDATA first, but ENOMEM seems better suited.)

>> +        }
> 
> fixed typo

Thanks.

> applied
> 
> thanks

Best regards,
Andreas



More information about the ffmpeg-devel mailing list