[vlc-devel] [PATCH 1/4] demux/mp4: store length of payload in MP4_Box_data_string_t

Filip Roséen filip at atch.se
Wed Nov 16 12:06:06 CET 2016


Hi Francois,

On 2016-11-16 11:58, Francois Cartegnie wrote:

> Le 16/11/2016 à 11:37, Filip Roséen a écrit :
> f165592 100644
> > --- a/modules/demux/mp4/libmp4.h
> > +++ b/modules/demux/mp4/libmp4.h
> > @@ -1176,6 +1176,7 @@ typedef struct
> >  typedef struct
> >  {
> >      char *psz_text;
> > +    uint64_t i_length;
> >  
> 
> ReadBox_String will never succeed with more than SIZE_MAX.

the usage of `uint64_t` was simply to provide consistency with other
boxes that uses `uint64_t` for the length (like `MP4_Box_s`). As such
I thought it would be appropriate to use the same type for the
*data-member* in question.

Also, `MP4_READBOX_ENTER_PARTIAL` uses `int64_t` for `i_read`, though
given that the `i_length` can never be negative I simply used
`uint64_t` to reflect the *value-type* of `i_read`.

If the entire patch-set gets the desired *LGTM* I can attach an update
patch to this one where a potentially smaller type is used. I do not
mind such change if one feels it is appropriate.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20161116/d5b9f728/attachment.html>


More information about the vlc-devel mailing list