[FFmpeg-devel] [PATCH] RTP/Vorbis payload implementation (GSoC qual task)

Michael Niedermayer michaelni
Mon Apr 13 14:59:40 CEST 2009


On Mon, Apr 13, 2009 at 12:58:01PM +0100, Colin McQuillan wrote:
> 2009/4/12 Michael Niedermayer <michaelni at gmx.at>:
> > On Sun, Apr 12, 2009 at 01:48:26PM +0100, Colin McQuillan wrote:
> >> Thanks for the reviews! Updated patch attached.
[...]
> Updated patch attached.
[...]
> @@ -261,18 +266,23 @@ int rtsp_next_attr_and_value(const char **p, char
>  static void sdp_parse_fmtp(AVStream *st, const char *p)
>  {
>      char attr[256];
> -    char value[4096];
> +    int value_alloc = FFMIN(INT_MAX,strlen(p));
> +    char *value = av_malloc(value_alloc);
>      int i;
>  
>      RTSPStream *rtsp_st = st->priv_data;
>      AVCodecContext *codec = st->codec;
>      RTPPayloadData *rtp_payload_data = &rtsp_st->rtp_payload_data;
>  
> +    if (!value)
> +        return;
> +
>      /* loop on each attribute */
> -    while(rtsp_next_attr_and_value(&p, attr, sizeof(attr), value, sizeof(value)))
> +    while(rtsp_next_attr_and_value(&p, attr, sizeof(attr), value, value_alloc))
>      {
>          /* grab the codec extra_data from the config parameter of the fmtp line */
> -        sdp_parse_fmtp_config(codec, attr, value);
> +        sdp_parse_fmtp_config(codec, rtsp_st->dynamic_protocol_context,
> +                              attr, value);
>          /* Looking for a known attribute */
>          for (i = 0; attr_names[i].str; ++i) {
>              if (!strcasecmp(attr, attr_names[i].str)) {
> @@ -283,6 +293,7 @@ static void sdp_parse_fmtp(AVStream *st, const cha
>              }
>          }
>      }
> +    av_free(value);
>  }
>  

the value malloc change is a seperate thing and belongs in a seperate patch

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

There will always be a question for which you do not know the correct awnser.
-------------- 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/20090413/df6d9f66/attachment.pgp>



More information about the ffmpeg-devel mailing list