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

Ganesh Ajjanagadde gajjanag at mit.edu
Thu Dec 17 22:54:16 CET 2015


On Thu, Dec 17, 2015 at 12:54 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Sun, Dec 13, 2015 at 07:04:54AM -0500, Ganesh Ajjanagadde wrote:
>> 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?
>
> it might be a good idea, i dont know

Should be a good idea IMHO, patch posted.

>
> [...]
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> The real ebay dictionary, page 2
> "100% positive feedback" - "All either got their money back or didnt complain"
> "Best seller ever, very honest" - "Seller refunded buyer after failed scam"
>
> _______________________________________________
> ffmpeg-cvslog mailing list
> ffmpeg-cvslog at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
>


More information about the ffmpeg-cvslog mailing list