[FFmpeg-devel] [qt-faststart] Ever get "could not allocate 0x14 byte for ftyp atom"?

matthieu castet castet.matthieu
Thu Feb 28 20:17:34 CET 2008


Mike Melanson wrote:
> Baptiste Coudurier wrote:
> 
> I have reviewed the relevant code. It seems pretty clear-- the user
> obviously doesn't have 0x14 bytes left to allocate. :)
> 
> ftyp_atom_size = atom_size;
> ftyp_atom = malloc(ftyp_atom_size);
> if (!ftyp_atom) {
>     printf ("could not allocate 0x%llX byte for ftyp atom\n",
>            atom_size);
>     fclose(infile);
>     return 1;
> }
> 
> The second user explained that 5169 failed outright while 5170 fails
> more spectacularly. 5170 was the first pass at loading FTYP. An error
> message for 5169 would be nice but I suspect we will never get it. Nor
> will we ever learn what tool generated the problem files.
> 
> One note about the FTYP loader code: it should probably sit after the
> 64-bit special case code. It's entirely possible -- though silly -- that
> an FTYP atom could specify a 64-bit length field. Based on the available
> data, that wouldn't be causing this failure.
> 
May the file has a lot's FTYP atoms.
The code does malloc without checking if ftyp_atom!=NULL in a loop.
This can lead to a great memory DOS for broken files...


Matthieu






More information about the ffmpeg-devel mailing list