[FFmpeg-devel] [PATCH 02/41] avformat/avidec: use ff_alloc_extradata()

Michael Niedermayer michaelni at gmx.at
Sun Oct 13 15:20:42 CEST 2013


On Sun, Oct 13, 2013 at 12:48:23PM +0000, Paul B Mahol wrote:
> Signed-off-by: Paul B Mahol <onemda at gmail.com>
> ---
>  libavformat/avidec.c | 12 ++----------
>  1 file changed, 2 insertions(+), 10 deletions(-)
> 
> diff --git a/libavformat/avidec.c b/libavformat/avidec.c
> index 44ab9d9..1a40e94 100644
> --- a/libavformat/avidec.c
> +++ b/libavformat/avidec.c
> @@ -648,12 +648,8 @@ static int avi_read_header(AVFormatContext *s)
>                              st->codec->extradata_size = esize - 10 * 4;
>                          } else
>                              st->codec->extradata_size =  size - 10 * 4;
> -                        st->codec->extradata      = av_malloc(st->codec->extradata_size +
> -                                                              FF_INPUT_BUFFER_PADDING_SIZE);
> -                        if (!st->codec->extradata) {
> -                            st->codec->extradata_size = 0;
> +                        if (ff_alloc_extradata(st->codec, st->codec->extradata_size))

code like this together with
+    if (size >= INT32_MAX - FF_INPUT_BUFFER_PADDING_SIZE)
+        return AVERROR(EINVAL);

could leave extradata_size inconsistent with extradata

either ff_alloc_extradata( ) or callers should be changed to avoid
this

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

During times of universal deceit, telling the truth becomes a
revolutionary act. -- George Orwell
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20131013/79e91791/attachment.asc>


More information about the ffmpeg-devel mailing list