[FFmpeg-devel] [PATCH][VAAPI][2/6] Add common data structures and helpers (take 5)

Michael Niedermayer michaelni
Wed Mar 11 01:33:14 CET 2009


On Tue, Mar 10, 2009 at 10:50:06PM +0100, Gwenole Beauchesne wrote:
> Le 10 mars 09 ? 22:20, Michael Niedermayer a ?crit :
> 
> >> +    rds->slice_data             = NULL;
> >> +    rds->slice_data_size        = 0;
> >
> > memset(0) seems simpler if these are not guranteed to be allocated by
> > av_mallocz() or another zeroing alloc, but guranteeing this seems like
> > the best choice ...
> 
> So, you are suggesting to av_mallocz() hwaccel_data_private? That's  
> fine with me.

yes


> 
> >> [...]
> >> +    slice_params = rds->slice_params;
> >> +    if (rds->slice_count >= rds->n_slice_params_alloc) {
> >> +        rds->n_slice_params_alloc += 16;
> >> +        slice_params = av_realloc(rds->slice_params,
> >> +                                  rds->n_slice_params_alloc * rds- 
> >> >slice_param_size);
> >> +        if (!slice_params) {
> >> +            av_free(rds->slice_params);
> >> +            return NULL;
> >> +        }
> >> +        rds->slice_params = slice_params;
> >> +    }
> >
> > av_fast_realloc() might be usefull for this
> 
> It needs a size arg but I'd like to deal with a length arg.

the code above was duplicated a few times and also there are possible
integer overflows.

[...]

-- 
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/20090311/9985b164/attachment.pgp>



More information about the ffmpeg-devel mailing list