Commit Graph

168 Commits

Author SHA1 Message Date
Michael Niedermayer b0be6d8385 avformat/id3v2: remove unused variable
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-15 17:09:39 +01:00
Michael Niedermayer eb215be9ce Merge commit '54bc15d5ebfd07fd468743ba29f709ea19e840b9'
* commit '54bc15d5ebfd07fd468743ba29f709ea19e840b9':
  id3v2: fix reading v2.2 attached pictures

Conflicts:
	libavformat/id3v2.c

See: 05c3c568dc
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-15 13:01:40 +01:00
Michael Niedermayer 24c76bae5f Merge commit '932788be5af8dee062c77851b573ea47dd6d047a'
* commit '932788be5af8dee062c77851b573ea47dd6d047a':
  id3v2: add names to the parameters of ID3v2EMFunc.read

Conflicts:
	libavformat/id3v2.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-15 12:53:53 +01:00
Michael Niedermayer 7eef45a76f avformat/id3v2: Fix incompatible pointer type warnings
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-15 12:46:13 +01:00
Michael Niedermayer 06ec2f1d32 Merge commit '8809c974a3fb51f96e498a5556a4a5bbacc581ce'
* commit '8809c974a3fb51f96e498a5556a4a5bbacc581ce':
  id3v2: constify the 'tag' parameter to special metadata parsing callback

Conflicts:
	libavformat/id3v2.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-15 12:45:20 +01:00
Anton Khirnov 54bc15d5eb id3v2: fix reading v2.2 attached pictures
In v2.2, the picture type is not a zero-terminated string, but has a
constant size of 3 bytes.
2015-01-14 17:17:24 +01:00
Anton Khirnov 932788be5a id3v2: add names to the parameters of ID3v2EMFunc.read
Some of them are not immediately obvious.
2015-01-14 17:17:24 +01:00
Anton Khirnov 8809c974a3 id3v2: constify the 'tag' parameter to special metadata parsing callback
Those functions should not ever modify it.
2015-01-14 17:17:24 +01:00
wm4 ea7af58fc6 avformat/id3v2: support USLT tags
I think this turned out pretty terrible. There's no good way to add new
custom tags that write to AVFormatContext->metadata.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-06 16:39:52 +01:00
Michael Niedermayer 081913aec5 avformat/id3v2: Use av_freep() avoid leaving stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-20 16:53:14 +01:00
Benoit Fouet dc351e1381 id3v2: prefer TDRC for date over TDRL.
TDRL is what we used as a replacement of TYER, and, according to
http://id3.org/id3v2.4.0-changes :
    TYER - Year
        This frame is replaced by the TDRC frame, 'Recording time'
        [F:4.2.5].
So change TDRL usages to TDRC.

Fixes ticket #3694

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-04 14:11:53 +01:00
Benoit Fouet 242f8bb3a8 avformat/id3v2: support buggy id3v2.3 tag length in id3v2.4
Some encoders do not use syncsafe sizes in v2.4 id3 tags. Check the next
tag to try to choose between the two.

Fixes ticket #4003

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-17 16:05:53 +02:00
Benoit Fouet 8bcf425d06 avformat/id3v2: silence a warning when CONFIG_ZLIB is unset.
dlen is only read when CONFIG_ZLIB is set, so mark it as possibly
unused.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-16 15:54:02 +02:00
Michael Niedermayer 19bf1ed1f4 avformat/id3v2: Fix "warning: unused variable uncompressed_buffer_size" if zlib is unavailable
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-30 12:21:07 +02:00
Carl Eugen Hoyos ced0d6c14d Use correct msvc type specifiers for ptrdiff_t and size_t.
The Windows runtime aborts if it finds %t or %z.
Fixes ticket #3472.

Reviewed-by: Ronald Bultje
2014-04-24 18:01:30 +02:00
Peter Ross 5331773cc3 ff_id3v2_read: add option to limit ID3 magic number search
Several chunked formats (AIFF, IFF,DSF) store ID3 metadata within an 'ID3 '
chunk tag. If such chunks are stored sequentially, it is possible for the
ID3v2 parser to confuse the chunk tag for the ID3 magic number. e.g.

[1st chunk tag ('ID3 ') | chunk size] [ID3 magic number | metadata ...]
[2nd chunk tag ('ID3 ') | chunk size] [ID3 magic number | metadata ...]

Fixes ticket #3530.

Signed-off-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-19 04:25:01 +02:00
Peter Ross c94305ae23 ff_id3v2_free_extra_meta: set the pointer pointing to extra_meta to NULL
Fixes ticket #3530.

Signed-off-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-19 04:24:24 +02:00
Peter Ross 847d8af59a avformat/id3v2: decode compilation metadata
Described http://id3.org/iTunes%20Compilation%20Flag

Signed-off-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-15 04:29:19 +01:00
Anssi Hannula 7fdf245ab9 avformat/id3v2: allow ID3 parsing without AVFormatContext
Add ff_id3v2_read_dict() for parsing without AVFormatContext, but
instead with AVIOContext and AVDictionary.

AVFormatContext is still used for logging, if available.

Chapter parsing is the only non-logging functionality that actually
needs AVFormatContext, and AFAICS it should be modified to write the
data to ID3v2ExtraMeta first, from where it can be implanted to
AVFormatContext by a separate function (like it is done with
read_apic() and ff_id3v2_parse_apic()). That is outside the scope of
this patch, though.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
2013-12-31 05:15:19 +02:00
Anssi Hannula 53765ae33b avformat/id3v2: parse ID3 Private frames as extra metadata
They are used in HLS.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
2013-12-31 03:18:53 +02:00
Carl Eugen Hoyos 05c3c568dc Read pictures in id3v2.2 2013-12-23 23:41:37 +01:00
Michael Niedermayer ffbcb1c6f0 avformat/id3v2: Check avio_read() return value in read_chapter()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-15 22:11:28 +01:00
Michael Niedermayer 460f8fca9c avformat/id3v2: factor free code to the end of read_chapter()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-15 21:43:19 +01:00
Michael Niedermayer 476aceaa22 vformat/id3v2: check avio_read for short reads in addition to errors
Found-by: ubitux
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-15 20:13:45 +01:00
Michael Niedermayer 0e0f6bd4a5 avformat/id3v2: Check avio_read() return code in id3v2_parse()
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f5a04a9b50d_7087_mp3__mp3__tooSmallFinal.mp3
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-15 15:45:44 +01:00
Michael Niedermayer 6241e8a382 id2v2: check the return value of decode_str()
Fixes CID1030348
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-06-09 17:25:39 +02:00
Paul B Mahol 379fcc4955 id3v2: read all textual chapter subframes
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-06-07 09:28:07 +00:00
Paul B Mahol f5846dc98c id3v2: stop ignoring text encoding for chapter titles
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-05-06 00:54:13 +00:00
Michael Niedermayer 760f7d3a90 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  compat: msvc: Make sure the object files are included when linking statically
  id3v2: check for end of file while unescaping tags

Conflicts:
	configure
	libavformat/id3v2.c

Note, ffmpeg is not affected by the out of buffer write bug

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-03 15:50:01 +02:00
Luca Barbato af4cc2605c id3v2: check for end of file while unescaping tags
Prevent a serious out of buffer bound write.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2013-05-03 10:21:27 +02:00
Michael Niedermayer 0beff42823 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  id3v2: K&R formatting cosmetics
  ppc: Only compile AltiVec FFT assembly when AltiVec is enabled

Conflicts:
	libavformat/id3v2.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-02 12:49:23 +02:00
Luca Barbato 0671adbb18 id3v2: K&R formatting cosmetics
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2013-05-02 11:02:45 +02:00
Michael Niedermayer a5ba4e186b Merge commit 'e926b5ceb1962833f0c884a328382bc2eca67aff'
* commit 'e926b5ceb1962833f0c884a328382bc2eca67aff':
  avformat: Drop unnecessary ff_ name prefixes from static functions

Conflicts:
	libavformat/audiointerleave.c
	libavformat/mux.c
	libavformat/mxfenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-01 18:28:48 +02:00
Diego Biurrun e926b5ceb1 avformat: Drop unnecessary ff_ name prefixes from static functions 2013-04-30 16:16:23 +02:00
Michael Niedermayer cdafcf838c Merge commit '8d617b11cfc87b2c6056fee029ac5bc760af874a'
* commit '8d617b11cfc87b2c6056fee029ac5bc760af874a':
  id3v2: pad the APIC packets as required by lavc.
  dfa: check for invalid access in decode_wdlt().

Conflicts:
	libavformat/id3v2.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-04 13:41:01 +02:00
Anton Khirnov 8d617b11cf id3v2: pad the APIC packets as required by lavc.
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-04-04 07:54:15 +02:00
Michael Niedermayer 24cfe91a22 id3v2: allocate large enough buffer
Fixes array overread

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-29 05:01:38 +01:00
Michael Niedermayer 2653e12520 Merge commit '1afddbe59e96af75f1c07605afc95615569f388f'
* commit '1afddbe59e96af75f1c07605afc95615569f388f':
  avpacket: use AVBuffer to allow refcounting the packets.

Conflicts:
	libavcodec/avpacket.c
	libavcodec/utils.c
	libavdevice/v4l2.c
	libavformat/avidec.c
	libavformat/flacdec.c
	libavformat/id3v2.c
	libavformat/matroskaenc.c
	libavformat/mux.c
	libavformat/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-08 19:12:03 +01:00
Anton Khirnov 1afddbe59e avpacket: use AVBuffer to allow refcounting the packets.
This will allow us to avoid copying the packets in many cases.

This breaks ABI.
2013-03-08 07:33:45 +01:00
Matthieu Bouron b3b456b258 lavf/id3v2: seek back to previous offset if header size is not matched
Makes ff_id3v2_read reset stream position at the end of ID3 data if the
header size is not matched (caused by an EOF for example).

Current behaviour (without the patch):
    filesize = 400
    id3 data size = 399
    file offset after ff_id3v2_read is 400 instead of 399

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-20 04:39:56 +01:00
Matthieu Bouron 61625565e4 lavf/id3v2: cosmetics: reindent
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-19 14:37:44 +01:00
Michael Niedermayer 10416a4d56 id3v2: check index against buffer size. Fix out of array access
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-11-29 23:12:42 +01:00
Michael Niedermayer e9c372362c id3v2: restructure compressed and unsync code
This should fix the interaction between the 2.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-11-23 03:28:20 +01:00
Michael Niedermayer 08e26e7f5c id3v2: print ver/flags/len on debug level.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-11-22 19:31:04 +01:00
Michael Niedermayer a9cfbf6d4b Merge remote-tracking branch 'qatar/master'
* qatar/master:
  id3v2: fix reading unsynchronized frames.
  cdgraphics: fix incorrect vertical offset mask in cdg_scroll()
  apetag: fix error handling in ff_ape_parse_tag()

Conflicts:
	libavformat/id3v2.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-11-22 15:36:50 +01:00
Anton Khirnov 9ae80e6a9c id3v2: fix reading unsynchronized frames.
Current code would incorrectly process e.g. 'ff 00 ff 00 ff' to
'ff ff ff', while it should be 'ff ff 00 ff'.

Fixes Bug 395.

CC: libav-stable@libav.org
2012-11-22 13:40:04 +01:00
Paul B Mahol 07ed191b15 parse ID3v2 chapters
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2012-10-28 15:10:28 +00:00
Piotr Bandurski 5081310b58 lavf: add missing new line to some error messages 2
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-01 17:35:21 +02:00
Michael Niedermayer d0bf3bf1ff Merge remote-tracking branch 'qatar/master'
* qatar/master:
  lavf: Detect discontinuities in timestamps for framerate/analyzeduration calculation
  lavf: Initialize the stream info timestamps in avformat_new_stream
  id3v2: Match PIC mimetype/format case-insensitively
  configure: Rename check_asm() to more fitting check_inline_asm()
  fate: Only test enabled filters
  avresample: De-doxygenize some comments where Doxygen is not appropriate
  rtmp: split chunk_size var into in_chunk_size and out_chunk_size
  rtmp: Factorize the code by adding find_tracked_method

Conflicts:
	configure

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-12 13:43:03 +02:00
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>
2012-08-12 11:00:19 +02:00