Mohammad Alsaleh
6e9bbc6525
id3v2: Match PIC mimetype/format case-insensitively
...
Some files' embedded art seems to have the mimetype 'image/JPG' instead
of 'image/jpg'. Libav fails to parse those because it matches
case-sensitively.
Use av_strncasecmp() to fix this behaviour.
Signed-off-by: Mohammad Alsaleh <msal@tormail.org>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
12 years ago
Mohammad Alsaleh
385ec296f1
id3v2: Support v2.2 PIC
...
id3 v2.2 uses image format ("JPG","PNG") instead of mimetypes.
Currently, the attached picture is skipped because the format string
does not match a known picture mimetype.
This patch fixes this behaviour.
Signed-off-by: Mohammad Alsaleh <msal@tormail.org>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
12 years ago
Anton Khirnov
36ef5369ee
Replace all CODEC_ID_* with AV_CODEC_ID_*
12 years ago
Anton Khirnov
25b51b2c44
id3v2: add a mimetype for bmp pictures.
13 years ago
Piotr Bandurski
4d18f4c15b
id3v2: reject APICs with size of 0
...
fixes ticket #1324
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Clément Bœsch
e5fcf3646a
lavf/id3v2: always strdup the value.
...
This simplifies the code but also fix a warning: ff_id3v1_genre_str
array contains const strings so do the string dup now instead of in
av_dict_set().
13 years ago
Clément Bœsch
6ad974ae1c
lavf/id3v2: do not export empty fields.
...
This also avoids a memleak.
13 years ago
Anton Khirnov
ddb4431208
id3v2: fix skipping extended header in id3v2.4
...
In v2.4, the length includes the length field itself.
13 years ago
Kostya Shishkov
f704eb612b
id3v2: add another mimetype for JPEG image
13 years ago
Piotr Bandurski
3c6397404b
id3v2: support JPEG APIC with incorrect (image/jpg) MIME type
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Anton Khirnov
713f3062a7
id3v2: set the keyframe flag on attached pictures.
13 years ago
Anton Khirnov
393fd0d89e
id3v2: remove unused ff_id3v2_read().
...
Rename ff_id3v2_read_all to ff_id3v2_read().
13 years ago
Anton Khirnov
079ea6ca5f
lavf: export id3v2 attached pictures as streams.
13 years ago
Anton Khirnov
a93b09cb45
id3v2: read attached pictures and export them in ID3v2ExtraMeta.
13 years ago
Jean First
acc88f07d4
id3v2: fix compiler warning for uninitialized variables
...
Signed-off-by: Jean First <jeanfirst@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
084bd109fc
id3v2: fix variable type for uncompress()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Adrian Drzewiecki
7e09fe15d5
Process compressed id3v2 tags.
...
ID3v2.4 allows for zlib compressed tags, but libavformat skips them.
Implement code to inflate compressed tags.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Diego Biurrun
da9cea77e3
Fix a bunch of common typos.
13 years ago
Michael Niedermayer
aedd30b63a
id3v2: Fix null ptr crash in get_extra_meta_func()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Adrian Drzewiecki
dd7453a24e
Fix id3v2 extended header handling.
...
When skipping over the extended header, take into account
that the size field has already been read. The extended header
also takes up space, so adjust total header length accordingly.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Anton Khirnov
ec22979a1d
id3v2: fix type of ID3v2EMFunc.free()
13 years ago
Diego Biurrun
c4a378855e
id3v2: reduce the scope of some non-globally-used symbols/structures
13 years ago
Diego Biurrun
3b78c180e4
id3v2: cosmetics: move some declarations before the places they are used
13 years ago
Anton Khirnov
c780b543e7
id3v2: fix NULL pointer dereference
...
Bug found by Laurent Aimar fenrir at videolan org
13 years ago
Anton Khirnov
60df6b0048
id3v2: remove pointless casts
13 years ago
Anton Khirnov
d2961e4ebf
id3v2: read TXXX frames with two calls to decode_str() instead of one.
...
Read the key in the first, value in the second.
This allows to avoid pointless strdups and simplify decode_str() by
dropping two of its parameters.
13 years ago
Anton Khirnov
1e18d32d01
id3v2: don't discard the whole tag when encountering empty frames.
...
While they're technically invalid, it's better to skip them and try to
read the rest of the tag.
13 years ago
Reimar Döffinger
a1526cd78f
id3v2: Fix some (function) pointer types.
...
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Laurent Aimar
f57b00e897
Fixed NULL pointer dereference in id3v2 parser.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
David Goldwich
7a019dffe5
id3v2: add support for non-text and GEOB type tag frames
...
This extends the ID3v2 parser to allow for reading of non-text (i.e.
other than T***) meta tag frames providing a ff_id3v2_read_all()
function. An additional data structure 'ID3v2ExtraMeta' is introduced
for these tags since AVDictionary is string oriented and unsuitable
for binary data.
A parser for tag frames of type GEOB is implemented, which is needed
to extract keyring information from encrypted OMA files. GEOB data
is parsed into 'ID3v2ExtraMetaGEOB' data structures.
The routine to decode characters from different encodings to UTF-8,
formerly part of the read_ttag() function, is moved to its own
function. Because some tag frames contain subparts of unknown length,
the function is now also able to read until a null character is found.
In addition, the function now takes care of allocating a buffer long
enough to hold the decoded characters.
Signed-off-by: David Goldwich <david.goldwich@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
13 years ago
Anton Khirnov
d2d67e424f
Remove all uses of now deprecated metadata functions.
14 years ago
Alex Converse
86f868771b
id3v2: Check malloc result. ID3v2 tags can be very large.
14 years ago
Alex Converse
40a5dd2f35
id3v2: Initialize tflags for version 2.2.
14 years ago
Stefano Sabatini
64be0d1eda
id3v2: prevent unsigned integer overflow in ff_id3v2_parse()
...
In ff_id3v2_parse(), prevent unsigned integer overflow if data length
indicator is skipped and tlen is < 4.
Fix crash decoding file Allaby_cut.mp3, fix trac issue #182 .
14 years ago
Stefano Sabatini
b69e5ee902
id3v2: add @file doxy and link to format documentation
14 years ago
Anton Khirnov
c5f4c0fd5c
id3v2: skip broken tags with invalid size
...
fixes issue2649.
14 years ago
Anton Khirnov
1885488757
id3v2: don't explicitly skip padding
...
It's pointless, since there's a seek to the end of tag later.
14 years ago
Anton Khirnov
eb1e7f78ea
id3v2: simplify error handling.
...
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
14 years ago
Anton Khirnov
bca6dee386
id3v2: explicitly seek to the end of the tag after reading
...
Current code might stop in the middle of an invalid tag.
fixes issue2650
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
14 years ago
Mans Rullgard
2912e87a6c
Replace FFmpeg with Libav in licence headers
...
Signed-off-by: Mans Rullgard <mans@mansr.com>
14 years ago
Anton Khirnov
45a8a02a41
lavf: replace avio_seek(SEEK_CUR) with avio_skip where it makes sense
...
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
14 years ago
Anton Khirnov
56e2ac6b45
id3v2: merge TYER/TDAT/TIME to date tag
14 years ago
Anton Khirnov
ffb0304593
id3v2: fix typo in error message
...
Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit fb61a7c534
)
14 years ago
Anton Khirnov
fb61a7c534
id3v2: fix typo in error message
...
Signed-off-by: Mans Rullgard <mans@mansr.com>
14 years ago
Carl Eugen Hoyos
ac533ac458
Do not loop endlessly if id3v2 tag size is negative / too large.
...
Fixes the sample from issue 2649.
14 years ago
Anton Khirnov
384c9c2fa7
avio: add avio_tell macro as a replacement for url_ftell
...
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
(cherry picked from commit a2704c9712
)
14 years ago
Anton Khirnov
a2704c9712
avio: add avio_tell macro as a replacement for url_ftell
...
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
14 years ago
Anton Khirnov
74b3f67c9c
lavf: replace all uses of url_fskip with avio_seek
...
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
(cherry picked from commit e356fc57a2
)
14 years ago
Anton Khirnov
f59d8ff8cd
avio: avio_ prefix for url_fseek
...
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
(cherry picked from commit 6b4aa5dac8
)
14 years ago
Anton Khirnov
e356fc57a2
lavf: replace all uses of url_fskip with avio_seek
...
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
14 years ago