14659 Commits

Author SHA1 Message Date
Michael Niedermayer
64624c5678 avformat/matroskadec: do not trust the default duration to be the real 1/timebase if its less than 5fps
Fixes Ticket3980

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit be695ee389724d713e1b8a61ef899fe1795193ce)
2014-11-01 16:12:52 +01:00
Michael Niedermayer
114e4b970e avformat/mp3dec: Improve seeking frame sync code
Fixes Ticket3884

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1b5ccae0f2045ac86bc9e1257cec1b3fba81315f)
2014-11-01 16:12:52 +01:00
Michael Niedermayer
c9659dfd29 avformat/mpeg: increase score for short mpeg-ps by 1
Fixes Ticket 3855

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5109ce2017c15202275b33bce58ec9d88044eeb5)

Conflicts:
	libavformat/mpeg.c
2014-11-01 16:12:52 +01:00
Michael Niedermayer
23fdcd3b0a avformat/mpegts: Check desc_len / get8() return code
Fixes out of array read
Fixes: signal_sigsegv_844d59_10_signal_sigsegv_a17bb7_366_mpegts_mpeg2video_mp2_dvbsub_topfield.rec

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c3d7f00ee3e09801f56f25db8b5961f25e842bd2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:22:08 +02:00
Benoit Fouet
fe12b3a7a6 avformat/riffenc: Filter out "BottomUp" in ff_put_bmp_header()
Fixes Ticket1304

Commit message and extradata size bugfix by commiter
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6843b9dc78bc966bb30121828ef4f6b6755cf877)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:20:32 +02:00
Michael Niedermayer
56fb830c30 avformat/m4vdec: Check for non startcode 00 00 00 sequences in probe
Fixes miss detection of PCM as m4v
Fixes Ticket 3928

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7c1835c52a4be2e4e996f83c91a8d5a147b01100)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 18:40:33 +02:00
Michael Niedermayer
b4d2888ce8 avformat/swfdec: Do not change the pixel format
This is currently not supported
Fixes part of Ticket 3539

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c2430304dfb3cc0e3a59ce6d1b59ebdcc934a0c2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 18:40:33 +02:00
Michael Niedermayer
b3f30cb6d6 avformat/swfdec: Use side data to communicate w/h changes to the decoder
Fixes reading from freed data
Fixes part of Ticket3539

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1c55d0ff3202a04ebc67a72d72391104e9bdb633)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a9734e7d3017ffc9539eaac2a8acce3ad427f746)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 18:40:32 +02:00
Mika Raento
0484d7ad7e segment: don't access outside seg->frames array
Fixes wrong number of segments output and undefined memory access.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 58e0402e02ae5e466c33b9465c1465fdee68d342)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 18:40:32 +02:00
wm4
f1685bd31a oggdec: fix invalid free on error
The read_packet callback passes a pointer to a stack-allocated AVPacket.
Attempting to free it with av_free() makes no sense.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b173f5c15572cc82f68128599722e689df4ff137)

Conflicts:

	libavformat/oggdec.c
2014-09-20 18:40:32 +02:00
Michael Niedermayer
6dd718e416 Merge commit 'd14696c99ccac12a052ce10e70859ffc0293ed6a' into release/2.2
* commit 'd14696c99ccac12a052ce10e70859ffc0293ed6a':
  apetag: Fix APE tag size check

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 17:42:05 +02:00
Katerina Barone-Adesi
d14696c99c apetag: Fix APE tag size check
The size variable is (correctly) unsigned, but is passed to several functions
which take signed parameters, such as avio_read, sometimes after having
numbers added to it. So ensure that size remains within the bounds that
these functions can handle.

(cherry picked from commit b45ab61b24a8f2aeafdd4451491b1b30b7875ee5)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-09-17 07:18:39 -07:00
Anton Khirnov
3ac0638d57 mpegenc: limit the maximum muxrate
It is written to the file as a 22-bit value.

CC: libav-stable@libav.org
(cherry picked from commit 75bbaf2493a71ee66eaabe3c21fadd84d07888de)
Signed-off-by: Anton Khirnov <anton@khirnov.net>

Conflicts:
	libavformat/mpegenc.c
2014-08-27 06:30:52 +00:00
Michael Niedermayer
afbaf6b367 Merge commit '7788297a59656ececd84f602292bfeb79f7eedd7' into release/2.2
* commit '7788297a59656ececd84f602292bfeb79f7eedd7':
  mpegts: Do not try to write a PMT larger than SECTION_SIZE

Conflicts:
	libavformat/mpegtsenc.c

See: 842b6c14bcfc1c5da1a2d288fd65386eb8c158ad
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-23 02:32:04 +02:00
Michael Niedermayer
f1da6691a4 Merge commit '23376ae2f0247ff659724b6a5313639db0c991ad' into release/2.2
* commit '23376ae2f0247ff659724b6a5313639db0c991ad':
  mpegts: Define the section length with a constant

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-23 02:17:42 +02:00
Luca Barbato
7788297a59 mpegts: Do not try to write a PMT larger than SECTION_SIZE
Prevent out of array writes.

Similar to what Michael Niedermayer did to address the same issue.

Bug-Id: CVE-2014-2263
CC: libav-stable@libav.org

Signed-off-by: Diego Biurrun <diego@biurrun.de>
(cherry picked from commit e8049af1325dd59a51546c15b2e71a0f578e9d27)

Conflicts:
	libavformat/mpegtsenc.c
2014-08-13 13:57:47 -07:00
Luca Barbato
23376ae2f0 mpegts: Define the section length with a constant
The specification says the value is expressed in 10 bits including
the 4-byte CRC.

(cherry picked from commit 89616408e38ac7257e36976723df0e23d6ee1157)
Signed-off-by: Diego Biurrun <diego@biurrun.de>

Conflicts:
	libavformat/mpegtsenc.c
2014-08-13 13:53:20 -07:00
Michael Niedermayer
01c4fe7ee7 avformat/tee: flip assigment direction
Found-by: CSA
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2e6fdcb7f3c86491408a3699f0aa9dc52b7c5686)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 04:45:56 +02:00
Michael Niedermayer
2105f046f5 avformat/dv: implement fallback in dv_extract_pack()
Fixes Ticket2340
Fixes Ticket2341

Based-on mail from Dave Rice <dave@dericed.com>
Tested-by: Dave Rice <dave@dericed.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 88f038ac97a875f25c2eceac6d2107a09314984c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 04:13:38 +02:00
Michael Niedermayer
f02221d651 Merge commit 'f6b3dce952d66f87883a50d90d6e98416ee397df' into release/2.2
* commit 'f6b3dce952d66f87883a50d90d6e98416ee397df':
  librtmp: Don't free the temp url at the end of rtmp_open

Conflicts:
	libavformat/librtmp.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-30 20:32:53 +02:00
Martin Storsjö
f6b3dce952 librtmp: Don't free the temp url at the end of rtmp_open
librtmp can keep pointers to this string internally, and may
use them at shutdown as well.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 865461099e062de5a3a109c2a5be98004c11d8bd)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>

Conflicts:
	libavformat/librtmp.c
2014-07-27 10:14:33 -04:00
Michael Niedermayer
9f8e3e6d12 avformat: add av_stream_get_parser() to access avformat AVParser
The AVStream.parser field is considered private and its location cannot be
preserved while preserving also ABI compatibility to libav, as libav added fields
before it.
Some tools like ffmpeg.c access this field though

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 62227a70f0a4c07d7ead5775d8bad64797f8ef80)

Conflicts:

	RELEASE_NOTES
	doc/APIchanges
	libavformat/utils.c
	libavformat/version.h
2014-07-14 23:26:06 +02:00
Michael Niedermayer
9752ab6b9e avformat/utils: do not wait for packets from discarded streams for genpts
Fixes long loop
Fixes Ticket3208

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8202c49b43621c04e26d4a3aa83a10e1e5cc1836)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-14 23:26:06 +02:00
Michael Niedermayer
0d90143972 Merge commit '46c477c2a14b04a63ab11d31003b48fab6146a96' into release/2.2
* commit '46c477c2a14b04a63ab11d31003b48fab6146a96':
  Check mp3 header before calling avpriv_mpegaudio_decode_header().

Conflicts:
	libavformat/mp3enc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-14 22:26:06 +02:00
Martin Storsjö
16f7cbef56 oggenc: Set the right AVOption size for the pref_duration option
On big endian machines, the default value set via the faulty
AVOption ended up as 2^32 times too big.

This fixes the fate-lavf-ogg test which currently is broken on
big endian machines, broken since 3831362. Since that commit,
a final zero-sized packet is written to the ogg muxer in that test,
which caused different flushing behaviour on little and big endian
depending on whether the pref_duration option was handled as it
should or not.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 103243ca649cc305129ed0352bf4d97e5ddf4d80)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-06-26 12:58:28 +02:00
Justin Ruggles
46c477c2a1 Check mp3 header before calling avpriv_mpegaudio_decode_header().
As indicated in the function documentation, the header MUST be
checked prior to calling it because no consistency check is done
there.

CC:libav-stable@libav.org
(cherry picked from commit f2f2e7627f0c878d13275af5d166ec5932665e28)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-06-26 12:37:16 +02:00
Michael Niedermayer
d07be523f5 avformat/mpc: attempt to allocate a packet that is not smaller than the data inside it
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 86a9370e2b91d67375e66a06d6eb573b5a017775)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-23 15:56:15 +02:00
Michael Niedermayer
e4cdde96b3 avformat/cavsvideodec: Fix probing when the file extension is avs
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 52e563bb2f7897d615391520c3c4acba1ee7dcb4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-23 15:56:15 +02:00
Michael Niedermayer
e173834af8 avformat/flvenc: Do not allow creating h263/mpeg4 in flv without unofficial format extensions being enabled.
Found-by: Jean-Baptiste Kempf <jb@videolan.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 74760883fcb4443d105814ed246b3cf51d7e9dca)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-23 15:56:15 +02:00
Carl Eugen Hoyos
52572ca1b3 Show duration for large asf files as written in the file header.
Fixes ticket #3428.
(cherry picked from commit e3fd263f0b73e4425192d6dd1ab18027ecaa35db)
2014-06-21 21:52:05 +02:00
Michael Niedermayer
f378636d90 avformat/mp3enc: drop redundant and uninitialized variable
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit eccec203978e53f897a3c6105d011bbdff2a978b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-19 21:05:12 +02:00
Carl Eugen Hoyos
d1b62a9a07 Do not limit blocksize when reading PCM from aiff.
Fixes ticket #3695.
(cherry picked from commit 763e714442e07f6430b003c8a9f4b62deaa7b3a5)
2014-06-09 23:48:10 +02:00
Michael Niedermayer
29c8fac3f7 avformat/avidec: allow rounding errors between scale/rate and timebase
Fixes Ticket3670

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 571ab8344a9a2864d22d01af41283cee9328b927)
2014-06-09 23:47:35 +02:00
Michael Niedermayer
54bec22a6e avformat/h263dec/h263_probe: Check TR
Fixes missdetection of Misdetection_345.mp3
Fixes missdetection of Misdetection_421.mp3
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cd20b93e2f5171054d6b3dd9daee1e832c1f9090)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 22:59:50 +02:00
Michael Niedermayer
e1b2c93a23 avformat/h263dec/h263_probe: Check PSC bit 9 and 13 in
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3ad21c50af042ab17bedf755ff8245392425c259)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 22:59:50 +02:00
Michael Niedermayer
e529ff52a0 avformat/h263dec: shift data in state to make more bits available to probe
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 04b15a6055fc230a655091ce21303f9d2a996ed9)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 22:59:50 +02:00
Michael Niedermayer
96047b3150 avformat/utils: Call ff_rfps_add_frame() only for video
This avoids some unneeded computations

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6f6edfe1c0ede584ea4edf5bb0fc9b961f299631)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 22:59:50 +02:00
Michael Niedermayer
2545defeac avformat/flvenc: fix assertion failure after 4h muxing
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2e532aa82d2b938a3cd913a363a79bf92ddf1a33)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 22:59:50 +02:00
Michael Niedermayer
a5a6f6fec3 avformat/mov: allow seeking back to the begin even if nothing is marked as keyframe
Fixes Ticket 3663

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 96470ca22b3b46677de0e2df64e87c5ec80d752b)
2014-05-31 12:22:20 +02:00
Carl Eugen Hoyos
bb01956d67 Use Matroska document version 2 for WebM files if possible.
Google's plugin for the Internet Explorer refuses to play
files with another document version.

Fixes ticket #3583.
(cherry picked from commit ab21acecc72a0299895583cf83347ab5e2444b71)
2014-05-12 23:20:05 +02:00
Michael Niedermayer
bc0c49b83e avformat/avidec: remove unused variables
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cc8b45c0ce35465fd0efee7103e41bcc28251f99)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-11 18:18:31 +02:00
Michael Niedermayer
2aa6592338 Merge commit '7f954ca502a16feeca44d4e9a7d450b404dabc94' into release/2.2
* commit '7f954ca502a16feeca44d4e9a7d450b404dabc94':
  avi: Improve non-interleaved detection

Conflicts:
	Changelog
	libavformat/avidec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-11 17:59:58 +02:00
Michael Niedermayer
2b14d98086 avformat/avidec: Check required demuxing buffer sizes in guess_ni_flag()
Fixes Ticket3421

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5d75730c58f72918a41bb5abda4b448ecdd4273c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-11 17:59:50 +02:00
Michael Niedermayer
7f954ca502 avi: Improve non-interleaved detection
Additional fixes by Nigel Touati-Evans <nigel.touatievans@gmail.com>.

Check the index for streams with a time drift of 2s or a buffer drift
of 64MB.

Bug-Id: 666
CC: libav-stable@libav.org
Sample-Id: yet-another-broken-interleaved-avi.avi

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Signed-off-by: Diego Biurrun <diego@biurrun.de>
(cherry picked from commit 9d599e3f6e61438772d8cddd6c9b7c495251f51e)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-05-10 12:00:40 -04:00
Martin Storsjö
7d97cc8d87 rtmpproto: Check the buffer sizes when copying app/playpath strings
As pointed out by Reimar Döffinger.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 0bacfa8d37710b904897e7cbeb8d6f96fbf75e2e)

Conflicts:
	libavformat/rtmpproto.c
2014-05-08 20:00:47 -04:00
Michael Niedermayer
f1b5830182 avformat/h263dec: Fix h263 probe
The code was missing 1 bit in the src format

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit fc145e576a443bfc89efdf35b91fd3c9ca0d8388)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 00:09:17 +02:00
Michael Niedermayer
27a3a59428 avformat/mpegts: Remove redundant check
Fixes part of Ticket3466
Found-by: Andrey_Karpov / PVS-Studio
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ff6fa0b4b980fc5b9f7653d7b159ae02c3d95210)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 00:09:17 +02:00
Stephan Soller
e3b08b3ad4 avformat/rtmpproto: Added handling of an initial RTMP chunk size packet.
Fixes ticket #2911.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 36b9c27dae452e10b4fff3d10f836160a5b8fbbd)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 00:09:17 +02:00
Michael Niedermayer
fa16440659 Merge commit '79041d92ee7421853ee8c57fc13891cb0c272e0e' into release/2.2
* commit '79041d92ee7421853ee8c57fc13891cb0c272e0e':
  matroska: add the Opus mapping

Conflicts:
	libavformat/matroska.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-04 21:25:27 +02:00
Michael Niedermayer
c36fd16aaa Merge commit '82cebc0e0544dce507749dd9b1c2983f083de836' into release/2.2
* commit '82cebc0e0544dce507749dd9b1c2983f083de836':
  matroskadec: read the CodecDelay element

Conflicts:
	libavformat/matroska.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-04 21:01:38 +02:00