[FFmpeg-devel] [PATCH v2] avcodec/mpegvideo_enc: Add check for av_packet_new_side_data()

2024-06-10 Thread Jiasheng Jiang
Add check for av_packet_new_side_data() to avoid null pointer dereference if allocation fails. Fixes: bdc1220eeb ("h263enc: Add an option for outputting info about MBs as side data") Signed-off-by: Jiasheng Jiang --- Changelog: v1 -> v2: Wrap lines in the body of the c

[FFmpeg-devel] [PATCH] avcodec/mpegvideo_enc: Add check for av_packet_new_side_data()

2024-06-09 Thread Jiasheng Jiang
Add check for av_packet_new_side_data() to avoid null pointer dereference if allocation fails. Fixes: bdc1220eeb ("h263enc: Add an option for outputting info about MBs as side data") Signed-off-by: Jiasheng Jiang --- libavcodec/mpegvideo_enc.c | 2 ++ 1 file changed, 2 insertion

[FFmpeg-devel] [PATCH] bsf: Fix memory leak by adding vp9_raw_reorder_frame_free()

2024-06-04 Thread Jiasheng Jiang
Add vp9_raw_reorder_frame_free() before "ctx->next_frame = NULL;" to avoid memory leak. Fixes: 887a7817b6 ("lavc: move bitstream filters into bsf/ subdir") Signed-off-by: Jiasheng Jiang --- libavcodec/bsf/vp9_raw_reorder.c | 1 + 1 file changed, 1 insertion(+) diff

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

2022-02-22 Thread Jiasheng Jiang
investigate yet) samplerate is stored wrong by libnut (demuxer has a workaround) code is not clean or beautifull yet, but i thought its better to commit early before someone unneccesarily wastes his time duplicating the work demuxer split from muxer") Signed-off-by: Jiasheng Jiang ---

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

2022-02-22 Thread Jiasheng Jiang
Michael Niedermayer: >> diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c >> index 0a8a700acf..32a4f6bbcb 100644 >> --- a/libavformat/nutdec.c >> +++ b/libavformat/nutdec.c >> @@ -351,8 +351,13 @@ static int decode_main_header(NUTContext *nut) >> ret = AVERROR(ENOMEM); >> g

Re: [FFmpeg-devel] [PATCH] avformat: Add check for ff_get_extradata

2022-02-22 Thread Jiasheng Jiang
On Tue, Feb 22, 2022 at 04:10:51PM +0800, Paul B Mahol wrote: >> As the potential failure of the memory allocation, the ff_get_extradata() >> could return error if fails. >> Therefore, it should be better to deal with the return value of the >> ff_get_extradata() and return error if fails. >> > >

[FFmpeg-devel] [PATCH] avformat: Add check for ff_get_extradata

2022-02-21 Thread Jiasheng Jiang
As the potential failure of the memory allocation, the ff_get_extradata() could return error if fails. Therefore, it should be better to deal with the return value of the ff_get_extradata() and return error if fails. Fixes: 2d720069a9 ("avformat: add aix demuxer") Signed-off-by: Jias

[FFmpeg-devel] [PATCH] avcodec/magicyuvenc: Add check for av_frame_clone

2022-02-21 Thread Jiasheng Jiang
As the potential failure of the memory allocation, the 'p' could be NULL pointer. Therefore, it should be better to check it in order to avoid the dereferencing of the NULL pointer. Fixes: 3729ae659f ("avcodec: add MagicYUV encoder") Signed-off-by: Jiasheng Jiang --- liba

[FFmpeg-devel] [PATCH] fftools/ffmpeg_filter: Add check for av_memdup

2022-02-21 Thread Jiasheng Jiang
As the potential failure of the av_malloc(), the av_memdup() could return NULL if fails. Therefore, it should be better to check it and return error if fails, like the av_buffer_ref(). Fixes: 535a835e51 ("ffmpeg: use display matrix frame side data for autorotation") Signed-off-by: Jias

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

2022-02-21 Thread Jiasheng Jiang
investigate yet) samplerate is stored wrong by libnut (demuxer has a workaround) code is not clean or beautifull yet, but i thought its better to commit early before someone unneccesarily wastes his time duplicating the work demuxer split from muxer") Signed-off-by: Jiasheng Jiang ---

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

[FFmpeg-devel] [PATCH] tests/checkasm/nlmeans: Add check for av_calloc

2022-02-16 Thread Jiasheng Jiang
As the potential failure of the av_calloc(), it should be better to check it and fail() if fails in order to avoid the dereference of the NULL pointer. Fixes: f679711c1b ("checkasm: add vf_nlmeans test for ssd_integral_image") Signed-off-by: Jiasheng Jiang --- tests/checkasm/vf_nlme

Re: [FFmpeg-devel] [PATCH] 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.") >

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
cs dont match mine (didnt investigate yet) samplerate is stored wrong by libnut (demuxer has a workaround) code is not clean or beautifull yet, but i thought its better to commit early before someone unneccesarily wastes his time duplicating the work demuxer split from muxer") Signed-off-by:

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

2022-02-15 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. Fixes: 84ad31ff18 ("lavf: replace av_new_stream->avformat_new_stream part II.") Signed-off-by: J

[FFmpeg-devel] [PATCH] avcodec/mlz: Add the check after calling av_mallocz

2022-02-15 Thread Jiasheng Jiang
to prevent the dereference of the NULL pointer. Also, the caller, the decode_init() needs to deal with the return value of ff_mlz_init_dict(). Fixes: 2f7a12fab5 ("avcodec/mlz: clear dict on allocation to ensure there are no uninitialized values") Signed-off-by: Jiasheng Jiang --- libav

[FFmpeg-devel] [PATCH] swscale/utils: Add missing check for av_malloc

2022-02-15 Thread Jiasheng Jiang
: f900a19fa9 ("libswscale: Adds ff_hscale8to15_4_avx2 and ff_hscale8to15_X4_avx2 for all filter sizes.") Signed-off-by: Jiasheng Jiang --- libswscale/swscale_internal.h | 2 +- libswscale/utils.c| 13 ++--- tests/checkasm/sw_scale.c | 3 ++- 3 files changed, 13

[FFmpeg-devel] [PATCH] avcodec/vp3: Add missing check for av_malloc

2022-02-15 Thread Jiasheng Jiang
Since the av_malloc() may fail and return NULL pointer, it is needed that the 's->edge_emu_buffer' should be checked whether the new allocation is success. Fixes: d14723861b ("VP3: fix decoding of videos with stride > 2048") Signed-off-by: Jiasheng Jiang --- libavcodec

[FFmpeg-devel] [PATCH] avcodec/vp6: return value check for av_mallocz

2022-02-06 Thread Jiasheng Jiang
d5 ("lavc/vp6: Implement "slice" threading for VP6A decode") Signed-off-by: Jiasheng Jiang --- libavcodec/vp6.c | 4 1 file changed, 4 insertions(+) diff --git a/libavcodec/vp6.c b/libavcodec/vp6.c index d024370793..d75e717082 100644 --- a/libavcodec/vp6.c +++ b/libavcodec/