[Ffmpeg-devel] patch for AVI files (original) (raw)
Michael Niedermayer michaelni
Sat Feb 11 14:14:59 CET 2006
- Previous message: [Ffmpeg-devel] patch for AVI files
- Next message: [Ffmpeg-devel] [PATCH] cook: use bitshift instead of pow(f) func
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi
On Fri, Feb 10, 2006 at 03:04:28PM +0530, Dilip Kumar Rai wrote:
Hello Developers, I am a developer working at AOL Bangalore on Audio Video search technology, I came to know about FFmpeg when I was evaluating various softwares for extracting meta data information (e.g. Title, Author, Genre etc..) from media files. I think FFmpeg is very good in handling many file formats and codecs, however we had to drop FFmpeg against native API's because it failed to extract metadata for many file formats. Nevertheless, I have decided to bridge this gap by providing missing functionality to FFmpeg. This fix is first in the series. I hope that this will add significant values to the product.
Nature of Fix: Added code for writing/reading INFO tags in AVI files. Description: With this fix it will be possible to extract and embeds INFO tags like, title, author, creation date etc... in a AVI file. With this fix generated files will be at least 28 bytes larger.
besides the tabs, trailing whitespace and typos (nah i dont care about the typos) ...
[...]
+ case MKTAG('I','C','O','P'): + { + //Coptright + getbuffer(pb, s->copyright, size); + } + break;
the {} on their own lines are unneeded (not a real issue but still its spreads the code over many pages and makes it hard to read IMHO) the comment is redunant as its just the variable name (i wont accept that) the indention doesnt follow the ffmpeg 4 space rule theres a heap overflow
[...]
+ char szDate[16]; + getbuffer(pb,szDate,size);
exploitable stack overflow
[...]
} +/** +Writes 'LIST INFO' tags to AVI streams. +Presently supported INFO tags are INAM, ICOP, ICMS, ICMT, ICRD, IPRP, IGNR, ISFT. More tags can be added later.... + at param pb [IN, OUT] ByteIOContext* + at param s [IN] AVFormatContext* +*/ +static void writeinfotags(ByteIOContext *pb, const AVFormatContext *s) +{ + int len; + offsett liststart=starttag(pb,"LIST"); + puttag(pb,"INFO"); + + len=strlen(s->title); + if(len>0) + { + len++; + len+=(len&1); + puttag(pb,"INAM"); + putle32(pb,len); + putbuffer(pb,s->title,len); + } + + //Coptright + len=strlen(s->copyright); + if(len>0) + { + len++; + len+=(len&1); + puttag(pb,"ICOP"); + putle32(pb,len); + putbuffer(pb, s->copyright, len); + }
this is a redundant mess, this should be put into a function or table, not repeated over and over again and are you sure the rounded up length should be stored?
[...]
-- Michael
- Previous message: [Ffmpeg-devel] patch for AVI files
- Next message: [Ffmpeg-devel] [PATCH] cook: use bitshift instead of pow(f) func
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]