[Ffmpeg-devel] Re: [PATCH] MXF demuxer

Michael Niedermayer michaelni
Wed Jul 19 23:48:39 CEST 2006


Hi

On Wed, Jul 19, 2006 at 11:49:03AM +0200, Baptiste Coudurier wrote:
> Hi
> 
> Michael Niedermayer wrote:
> > Hi
> > 
> > On Tue, Jul 18, 2006 at 01:32:34AM +0200, Baptiste Coudurier wrote:
> > [...]
> >>> [...]
> >>>
> >>> imagine when you click on a save button to save several hours work which
> >>> you did in a video editor, webpage with a little gif anim or similar
> >>> and suddenly the shiny GUI dissapears and the commandline presents you
> >>> with a "assert(desc->sample_rate.num % desc->sample_rate.den == 0) failed"
> >>> and all your hard work is gone ...
> >>>
> >> Hehe. I fully undertand the point here, but how this is comparable to
> >> the asserts in mov.c checking the time_rate ?
> > 
> > time_rate is calculated as the gcd of all sample "durations" so the asserts
> > should never fail 
> > 
> > [...]
> > 
> 
> Indeed. Here is a new version. Btw do you have any idea to tread those
> 16 bytes UID keys easier ?
> 
> Also Im thinking about the need of some sort of "pattern" to check
> against those key like "0x06... 0xXX, 0xXX" that way all hardcoded keys
> would be 16 bytes

hmm, you could of course use a "never occuring byte" and your own memcmp
which matches that to anything, iam not sure though if thats a good idea

[...]

> +static int mxf_read_metadata_source_package(MXFContext *mxf, KLVPacket *klv)
> +{
> +    ByteIOContext *pb = &mxf->fc->pb;
> +    int tracks_count;
> +    int bytes_read = 0;
> +    int i;
> +
> +    while (bytes_read < klv->length) {
> +        int tag = get_be16(pb);
> +        int size = get_be16(pb); /* KLV specified by 0x53 */
> +        
> +        switch (tag) {
> +        case 0x4403:
> +            tracks_count = get_be32(pb);
> +            if(tracks_count >= UINT_MAX / sizeof(*mxf->tracks))
> +                return -1;

this also needs a check for sizeof(*mxf->descriptors) i think

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is




More information about the ffmpeg-devel mailing list