[FFmpeg-devel] [PATCH] RTSP-MS 10/15: ASF header parsing
Michael Niedermayer
michaelni
Sat Jan 10 23:43:53 CET 2009
On Tue, Jan 06, 2009 at 08:49:06AM -0500, Ronald S. Bultje wrote:
> Hi Diego,
>
> On Tue, Jan 6, 2009 at 3:11 AM, Diego Biurrun <diego at biurrun.de> wrote:
> > On Tue, Jan 06, 2009 at 12:11:17AM -0500, Ronald S. Bultje wrote:
> >>
> >> --- /dev/null 1970-01-01 00:00:00.000000000 +0000
> >> +++ ffmpeg-svn/libavformat/rtp_asf.c 2009-01-05 23:40:36.000000000 -0500
> >> @@ -0,0 +1,53 @@
> >> +
> >> +void
> >> +ff_wms_parse_sdp_a_line (AVFormatContext *s, const char *p)
> >
> > K&R would put this on one line and leave out the space between the
> > name and the opening parenthesis.
> >
> >> --- /dev/null 1970-01-01 00:00:00.000000000 +0000
> >> +++ ffmpeg-svn/libavformat/rtp_asf.h 2009-01-05 23:40:36.000000000 -0500
> >> @@ -0,0 +1,35 @@
> >> +
> >> +#ifndef __RTP_ASF_H__
> >> +#define __RTP_ASF_H__
> >
> > You should know you're not allowed to do this by now :-p
>
> All fixed. Also removed some strange void -> transport_context that
> accidently made it into this patch...
[...]
> +void ff_wms_parse_sdp_a_line(AVFormatContext *s, const char *p)
> +{
> + if (av_strstart(p, "pgmpu:data:application/vnd.ms.wms-hdr.asfv1;base64,", &p)) {
> + ByteIOContext gb;
> + RTSPState *rt = s->priv_data;
> + int len = strlen(p) * 6 / 8;
> + char *buf = av_mallocz(len);
> + av_base64_decode(buf, p, len);
> +
> + init_put_byte(&gb, buf, len, 0, NULL, NULL, NULL, NULL);
> + if (rt->asf_ctx) {
> + av_close_input_stream(rt->asf_ctx);
> + rt->asf_ctx = NULL;
> + }
> + av_open_input_stream(&rt->asf_ctx, &gb, "", &asf_demuxer, NULL);
> + rt->asf_gb_pos = url_ftell(&gb);
unused
> + av_free(buf);
at that point you have a ByteIOContext in your context with a deallocated
buffer. This is ugly.
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
No snowflake in an avalanche ever feels responsible. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090110/3e5ec410/attachment.pgp>
More information about the ffmpeg-devel
mailing list