[FFmpeg-devel] [PATCH] avcodec: set correct return value in ff_mpeg_ref_picture

2017-11-27 Thread Pan Bian
In function ff_mpeg_ref_picture(), it returns 0 on the error path that the return value of av_buffer_ref() is NULL. 0 indicates success, which seems to deviate from the fact. Set ret to AVERROR(ENOMEM) to propagate the error status to the callers. Signed-off-by: Pan Bian <bianpan2...@163.

[FFmpeg-devel] avfilter/avf_ahistogram: return correct error code

2017-11-27 Thread Pan Bian
In function query_formats(), it incorrectly returns 0 when the function ff_all_channel_counts() returns a NULL pointer (the check of variable ret before the NULL check guarantees that the return value is not negative). Signed-off-by: Pan Bian <bianpan2...@163.com> --- libav

[FFmpeg-devel] avcodec/samidec: check av_strdup() return value

2017-11-26 Thread Pan Bian
From: Pan Bian <bian...@163.com> In function sami_paragraph_to_ass(), the return value of av_strdup() is not checked. To avoid potential NULL dereference, the return value should be checked against NULL. Signed-off-by: Pan Bian <bian...@163.com> --- libavcodec/samidec.c | 3 +++ 1

[FFmpeg-devel] ffmpeg: Check read_ffserver_streams() return value

2017-11-26 Thread Pan Bian
dereference. Signed-off-by: Pan Bian <bianpan2...@163.com> --- fftools/ffmpeg_opt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c index 9445a2d..7e51c5a 100644 --- a/fftools/ffmpeg_opt.c +++ b/fftools/ffmpeg_opt.c @@ -2000,6 +2000,8 @@ stat

[FFmpeg-devel] libavformat/rtpenc_mpegts: check avformat_new_stream() return value

2017-11-26 Thread Pan Bian
The function avformat_new_stream() returns a NULL pointer on failure. However, in function rtp_mpegts_write_header(), its return value is not validated before it is dereferenced. Check the return value against NULL to avoid potential NULL dereference. Signed-off-by: Pan Bian <bianpan2...@163.

[FFmpeg-devel] avcodec/nvenc: set correct error code

2017-11-26 Thread Pan Bian
In function process_output_surface(), the return value is 0 on the path that av_mallocz() returns a NULL pointer. 0 indicates success, which deviates from the fact. Return "AVERROR(ENOMEM)" instead of "0". Signed-off-by: Pan Bian <bianpan2...@163.com> --- libavcode

[FFmpeg-devel] [FFmpeg-devel 1/2] avformat/mov: set correct error code in mov_read_custom

2017-11-26 Thread Pan Bian
In function mov_read_custom(), it returns 0 on the path that av_malloc() returns a NULL pointer. 0 indicates success. An error code should be assigned to ret. Signed-off-by: Pan Bian <bianpan2...@163.com> --- libavformat/mov.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff

[FFmpeg-devel] [FFmpeg-devel 2/2] avformat/mov: return correct value in mov_read_cmov

2017-11-26 Thread Pan Bian
On some failure paths, the error code is not correctly set. Signed-off-by: Pan Bian <bianpan2...@163.com> --- libavformat/mov.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavformat/mov.c b/libavformat/mov.c index d25071b..bbf550f 100644 --- a/libavformat/mov.c +++ b/libavformat

[FFmpeg-devel] avcodec/hevc_ps: set correct return value

2017-11-26 Thread Pan Bian
When the call to get_bits_left() fails, the return value is not an negative error code. This patch explicitly assignes an error code to the return variable ret. Signed-off-by: Pan Bian <bianpan2...@163.com> --- libavcodec/hevc_ps.c | 1 + 1 file changed, 1 insertion(+) diff --git a/liba

[FFmpeg-devel] [FFmpeg-devel 1/1] avformat/rtpenc_mpegts: check avformat_new_stream() return value

2017-11-26 Thread Pan Bian
The function avformat_new_stream() returns a NULL pointer on failure. However, in function rtp_mpegts_write_header(), its return value is not validated before it is dereferenced. Check the return value against NULL to avoid potential NULL dereference. Signed-off-by: Pan Bian <bianpan2...@163.

[FFmpeg-devel] [FFmpeg-devel 1/1] avcodec/samidec: check av_strdup() return value

2017-11-26 Thread Pan Bian
In function sami_paragraph_to_ass(), the return value of av_strdup() is not checked. To avoid potential NULL dereference, the return value should be checked against NULL. Signed-off-by: Pan Bian <bianpan2...@163.com> --- V2: fix patcheck warnings --- libavcodec/samidec.c | 3 +++ 1 file c

[FFmpeg-devel] [FFmpeg-devel V2] avformat/rtpenc_mpegts: check avformat_new_stream() return value

2017-11-26 Thread Pan Bian
The function avformat_new_stream() returns a NULL pointer on failure. However, in function rtp_mpegts_write_header(), its return value is not validated before it is dereferenced. Check the return value against NULL to avoid potential NULL dereference. Signed-off-by: Pan Bian <bianpan2...@163.