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

Michael Niedermayer michaelni at gmx.at
Sun Oct 13 17:52:18 CEST 2013


On Sun, Oct 13, 2013 at 02:52:17PM +0000, Paul B Mahol wrote:
> On 10/13/13, Michael Niedermayer <michaelni at gmx.at> wrote:
> > 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
> 
> changed ff_alloc_extradata to set extradata_size to 0.

thx
rest of patches LGTM from a quick look

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

In fact, the RIAA has been known to suggest that students drop out
of college or go to community college in order to be able to afford
settlements. -- The RIAA
-------------- 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/8ed51eaa/attachment.asc>


More information about the ffmpeg-devel mailing list