[FFmpeg-devel] [PATCH] RTSP-MS 10/15: ASF header parsing

Ronald S. Bultje rsbultje
Sat Jan 31 16:23:52 CET 2009


Hi Michael,

2009/1/10 Michael Niedermayer <michaelni at gmx.at>:
> On Tue, Jan 06, 2009 at 08:49:06AM -0500, Ronald S. Bultje wrote:
>> +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.

Do you want me to set s->gb = NULL; or would you prefer an alternative solution?

Ronald




More information about the ffmpeg-devel mailing list