On Mon, 4 Aug 2014 20:34:46 +0300 (EEST), =?ISO-8859-15?Q?Martin_Storsj=F6?= 
<[email protected]> wrote:
> On Mon, 4 Aug 2014, Felix Abecassis wrote:
> 
> > Fix access to uninitialized memory on a side data of type STEREO3D.
> > ---
> > libavutil/frame.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libavutil/frame.c b/libavutil/frame.c
> > index 4b44075..0e7fd07 100644
> > --- a/libavutil/frame.c
> > +++ b/libavutil/frame.c
> > @@ -464,7 +464,7 @@ AVFrameSideData *av_frame_new_side_data(AVFrame *frame,
> >     if (!ret)
> >         return NULL;
> >
> > -    ret->data = av_malloc(size);
> > +    ret->data = av_mallocz(size);
> >     if (!ret->data) {
> >         av_freep(&ret);
> >         return NULL;
> > -- 
> > 1.9.1
> 
> I think we rather should make sure we really initialize all of the side 
> data in the case of STEREO3D - then it's easier to spot missed 
> initialization of other side data types, while this patch would hide other 
> such issues.
> 
> OTOH, implicitly initializing all frame side data might be a useful 
> detail (and could be regarded as a safety fallback - if someone misses to 
> initialize something it will at least behave consistently).
> 
> Anton?

I'm also not fully decided here.

We are considering exporting some quite large arrays through this API, like the
motion vectors or quantizers. Initializing those could take a significant amount
of time.
Then there's the possiblity of this hiding bugs.

I'll think on this some more.
Meanwhile, anyone got a stronger opinion?

-- 
Anton Khirnov
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to