Am 12.04.2011 um 18:30 schrieb Justin Ruggles:

> On 04/12/2011 11:48 AM, Max Horn wrote:
> 
>> diff --git a/libavformat/wtv.c b/libavformat/wtv.c
>> index 8260fe1..524d222 100644
>> --- a/libavformat/wtv.c
>> +++ b/libavformat/wtv.c
>> @@ -675,7 +675,9 @@ static AVStream * parse_media_type(AVFormatContext *s, 
>> AVStream *st, int sid,
>>         if (!st)
>>             return NULL;
>>         if (!ff_guidcmp(formattype, format_waveformatex)) {
>> -            ff_get_wav_header(pb, st->codec, size);
>> +            int ret = ff_get_wav_header(pb, st->codec, size);
>> +            if (ret < 0)
>> +                return ret;
>>         } else {
>>             if (ff_guidcmp(formattype, format_none))
>>                 av_log(s, AV_LOG_WARNING, "unknown formattype:"PRI_GUID"\n", 
>> ARG_GUID(formattype));
> 
> 
> This function returns a pointer not an int, so it needs to return NULL
> on error instead of the error code.

Well-spotted, thanks! (Or maybe I should say stupidly-overlooked by me? 
Whatever ;).

Attached is a corrected version.

Cheers,
Max

Attachment: 0002-handle-malloc-failures-in-ff_get_wav_header.patch
Description: Binary data

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

Reply via email to