[FFmpeg-devel] [PATCH 05/12] asf: replace VLA with malloc/free

Michael Niedermayer michaelni
Thu Jun 24 01:39:36 CEST 2010


On Wed, Jun 23, 2010 at 06:26:43PM +0100, Mans Rullgard wrote:
> ---
>  libavformat/asfdec.c |   10 ++++++++--
>  1 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
> index eb14146..025a00b 100644
> --- a/libavformat/asfdec.c
> +++ b/libavformat/asfdec.c
> @@ -1053,7 +1053,10 @@ static int64_t asf_read_pts(AVFormatContext *s, int stream_index, int64_t *ppos,
>      int64_t pts;
>      int64_t pos= *ppos;
>      int i;
> -    int64_t start_pos[s->nb_streams];
> +    int64_t *start_pos = av_malloc(s->nb_streams * sizeof(*start_pos));

asf uses a 7 bit id for streams, thus a fixed size array should do together
with a check that stops allocation of more streams than what packets could
refer to


[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Breaking DRM is a little like attempting to break through a door even
though the window is wide open and the only thing in the house is a bunch
of things you dont want and which you would get tomorrow for free anyway
-------------- 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/20100624/e58b8d4c/attachment.pgp>



More information about the ffmpeg-devel mailing list