[FFmpeg-devel] [PATCH 2/2] Add ID support for .oma/.aa3
Sat Jun 12 18:41:48 CEST 2010
Am Freitag, den 11.06.2010, 01:10 +0200 schrieb Reimar D?ffinger:
> On Fri, Jun 11, 2010 at 12:44:45AM +0200, Michael Karcher wrote:
> > + const uint8_t *buf;
> > +
> > + buf = p->buf;
> > + if (p->end >= p->buf + ID3v2_HEADER_SIZE
> > + && ff_id3v2_match(buf, ID3v2_EA3_MAGIC))
> > + buf += ff_id3v2_tag_len(buf);
> This may overflow
Sorry, you are right. And furthermore, p->end does not exist. I was too
careless on stealing that code from the mp3 format probe function.
> int tag_len = 0;
> if (...)
> tag_len = ff_id3v2_tag_len();
> // cannot overflow since tag_len is at most 28 bits
> if (p->size < tag_len + 5)
> return 0;
> buf += tag_len;
Thanks for your suggestion, I copied your idea, but added a low
confidence positive result in case the main header is not inside the
read-ahead buffer. PROBE_BUF_MIN is currently 2048 bytes, which is lower
than some observed header sizes.
ID3v2_HEADER_SIZE is small enough to fit into the padding even if no
input data is read, so checking for the ID header without checking the
size should be fine.
Add parsing of metadata in .oma/.aa3 files. They are just ID3v2 in
disguise starting with "ea3" instead of "ID3".
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 3361 bytes
Desc: not available
More information about the ffmpeg-devel