[FFmpeg-devel] [PATCH] HTTP options in HLS (again)

Micah Galizia micahgalizia at gmail.com
Wed Jan 23 03:13:49 CET 2013


On Tue, Jan 22, 2013 at 4:13 PM, Micah Galizia <micahgalizia at gmail.com>wrote:

> On Tue, Jan 22, 2013 at 4:01 PM, Stefano Sabatini <stefasab at gmail.com>wrote:
>
>> On date Friday 2013-01-18 21:24:44 -0500, Micah Galizia encoded:
>> > On Fri, Jan 18, 2013 at 2:14 PM, Stefano Sabatini <stefasab at gmail.com
>> >wrote:
>> [...]
>> > From 8e6abcbe032d5dbd9aab8163919319f1f6136639 Mon Sep 17 00:00:00 2001
>> > From: Micah Galizia <micahgalizia at gmail.com>
>> > Date: Fri, 18 Jan 2013 21:20:58 -0500
>> > Subject: [PATCH] broker important HTTP protocol options. Fixes ticket
>> #1291
>> >
>> > ---
>> >  libavformat/hls.c |   32 ++++++++++++++++++++++++++++++--
>> >  1 file changed, 30 insertions(+), 2 deletions(-)
>> [...]
>> > @@ -461,11 +475,25 @@ reload:
>> >
>> >  static int hls_read_header(AVFormatContext *s)
>> >  {
>> > +    URLContext *u = s->pb->opaque;
>> >      HLSContext *c = s->priv_data;
>> >      int ret = 0, i, j, stream_offset = 0;
>> >
>> >      c->interrupt_callback = &s->interrupt_callback;
>> >
>> > +    // if the URL context is good, read important options we must
>> broker later
>> > +    if (u) {
>> > +        // get the previous user agent & set back to null if string
>> size is zero
>>
>> > +        av_opt_get(u->priv_data, "user-agent", 0,
>> (uint8_t**)&(c->user_agent));
>> > +        if (!strlen(c->user_agent))
>> > +            av_freep(&c->user_agent);
>> > +
>> > +        // get the previous cookies & set back to null if string size
>> is zero
>> > +        av_opt_get(u->priv_data, "cookies", 0,
>> (uint8_t**)&(c->cookies));
>> > +        if (!strlen(c->cookies))
>> > +            av_freep(&c->cookies);
>>
>> Leak in case c->user_agent/cookies is already set.
>>
>
> Good point -- I just got burned like that in the HTTP protocol.
>
>
>>
>> I'll fix and push in a day if I read no more comments (but feel free
>> to send an updated patch).
>>
>
> Nah, I'll post something later this eventing. TIA
>

OK, fix attached.

TIA
-- 
"The mark of an immature man is that he wants to die nobly for a cause,
while the mark of the mature man is that he wants to live humbly for
one."   --W. Stekel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-broker-http-options.patch
Type: application/octet-stream
Size: 3560 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130122/e79b970e/attachment.obj>


More information about the ffmpeg-devel mailing list