[FFmpeg-devel] [PATCH 7/8] avformat/hlsenc: check for null context to avoid uninitialized pointer access

Steven Liu lq at chinaffmpeg.org
Fri Mar 30 09:32:36 EEST 2018



> On 30 Mar 2018, at 13:09, vdixit at akamai.com wrote:
> 
> From: Vishwanath Dixit <vdixit at akamai.com>
> 
> Under error conditions, when the context is null, the application crashes
> without this check.
> ---
> libavformat/hlsenc.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
> index 1dd196f..334720f 100644
> --- a/libavformat/hlsenc.c
> +++ b/libavformat/hlsenc.c
> @@ -2318,7 +2318,8 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
>     }
> 
>     vs->packets_written++;
> -    ret = ff_write_chained(oc, stream_index, pkt, s, 0);
> +    if (oc->pb)
> +        ret = ff_write_chained(oc, stream_index, pkt, s, 0);
> 
>     return ret;
> }
> -- 
> 1.9.1
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
LGTM

Thanks
Steven







More information about the ffmpeg-devel mailing list