Re: [FFmpeg-devel] [PATCH v2] avformat/nutdec: Add check for avformat_new_stream

2022-02-21 Thread Jiasheng Jiang
Michael Niedermayer: >> diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c >> index 0a8a700acf..4cbccb20d9 100644 >> --- a/libavformat/nutdec.c >> +++ b/libavformat/nutdec.c >> @@ -220,6 +220,10 @@ static int decode_main_header(NUTContext *nut) >> } >> >> GET_V(nut->time_base_coun

Re: [FFmpeg-devel] [PATCH v2] avformat/nutdec: Add check for avformat_new_stream

2022-02-17 Thread Michael Niedermayer
On Wed, Feb 16, 2022 at 04:40:16PM +0800, Jiasheng Jiang wrote: > As the potential failure of the memory allocation, > the avformat_new_stream() could return NULL pointer. > Therefore, it should be better to check it and return > error if fails. > Also, the caller, nut_read_header(), needs to deal

Re: [FFmpeg-devel] [PATCH v2] avformat/nutdec: Add check for avformat_new_stream

2022-02-16 Thread Jiasheng Jiang
Andreas Rheinhardt: >> As the potential failure of the memory allocation, >> the avformat_new_stream() could return NULL pointer. >> Therefore, it should be better to check it and return >> error if fails. >> >> Fixes: 84ad31ff18 ("lavf: replace av_new_stream->avformat_new_stream part >> II.") >

[FFmpeg-devel] [PATCH v2] avformat/nutdec: Add check for avformat_new_stream

2022-02-16 Thread Jiasheng Jiang
As the potential failure of the memory allocation, the avformat_new_stream() could return NULL pointer. Therefore, it should be better to check it and return error if fails. Also, the caller, nut_read_header(), needs to deal with the return value of the decode_main_header() and return error if memo