[FFmpeg-cvslog] avformat/hlsenc: Check the return code of avformat_write_header()

Ganesh Ajjanagadde gajjanag at mit.edu
Sun Dec 13 13:04:54 CET 2015


On Sat, Dec 12, 2015 at 9:30 PM, Michael Niedermayer <git at videolan.org> wrote:
> ffmpeg | branch: release/2.8 | Michael Niedermayer <michael at niedermayer.cc> | Sun Dec 13 02:28:13 2015 +0100| [d07f6582018d3388716340b08f1b1461c2f05bda] | committer: Michael Niedermayer
>
> avformat/hlsenc: Check the return code of avformat_write_header()
>
> Fixes: segfault
> Fixes: Ticket5067
>
> Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> (cherry picked from commit c62d1780fff8a1997dd1707bbc557efc8fe41e3c)
>
> Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
>
>> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d07f6582018d3388716340b08f1b1461c2f05bda
> ---
>
>  libavformat/hlsenc.c |    7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
> index 6827b79..ebc5e11 100644
> --- a/libavformat/hlsenc.c
> +++ b/libavformat/hlsenc.c
> @@ -548,8 +548,11 @@ static int hls_start(AVFormatContext *s)
>      if (oc->oformat->priv_class && oc->priv_data)
>          av_opt_set(oc->priv_data, "mpegts_flags", "resend_headers", 0);
>
> -    if (c->vtt_basename)
> -        avformat_write_header(vtt_oc,NULL);
> +    if (c->vtt_basename) {
> +        err = avformat_write_header(vtt_oc,NULL);
> +        if (err < 0)
> +            return err;
> +    }
>
>      return 0;
>  }
>
> _______________________________________________
> ffmpeg-cvslog mailing list
> ffmpeg-cvslog at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

any reason why we can't use av_warn_unused_result to help for the future here?


More information about the ffmpeg-cvslog mailing list