12357 Commits

Author SHA1 Message Date
Michael Niedermayer
0a6d397911 Merge commit 'bbd632082b18e6c5ce9c2d6be8bc260c05ae9417' into release/1.1
* commit 'bbd632082b18e6c5ce9c2d6be8bc260c05ae9417':
  mpegenc: limit the maximum muxrate

Conflicts:
	libavformat/mpegenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-30 20:50:50 +02:00
Michael Niedermayer
807b738840 Merge commit 'addbaf134836aea4e14f73add8c6d753a1373257' into release/1.1
* commit 'addbaf134836aea4e14f73add8c6d753a1373257':
  mpegts: Do not try to write a PMT larger than SECTION_SIZE

Conflicts:
	libavformat/mpegtsenc.c

See: 694c3a13c9489c6e05f88486b489dd0746d114fc
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-30 20:31:50 +02:00
Michael Niedermayer
a507fea707 Merge commit '694b7cd873f8b06af109036eff1ccd741afdd28e' into release/1.1
* commit '694b7cd873f8b06af109036eff1ccd741afdd28e':
  mpegts: Define the section length with a constant

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-30 20:20:01 +02:00
Anton Khirnov
bbd632082b 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

(cherry picked from commit 3ac0638d573fc483ba6be3444858b26711c5d67d)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-27 06:36:48 +00:00
Michael Niedermayer
fe461238d3 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-08-08 16:19:48 +02:00
Michael Niedermayer
cf7f798984 Merge commit 'd7dbc687e312a91ef2ccf797d57b95c61d0e8a2f' into release/1.1
* commit 'd7dbc687e312a91ef2ccf797d57b95c61d0e8a2f':
  Check mp3 header before calling avpriv_mpegaudio_decode_header().

Conflicts:
	libavformat/mp3enc.c

See: See: 2dd0da787ce5008d4d1b8f461fbd1288c32e2c38
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-08 12:52:20 +02:00
Luca Barbato
addbaf1348 mpegts: Do not try to write a PMT larger than SECTION_SIZE
Prevent out of array write.

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

Bug-Id: CVE-2014-2263
CC: libav-stable@libav.org
2014-08-07 20:07:31 +02:00
Luca Barbato
694b7cd873 mpegts: Define the section length with a constant
The specification says the value is expressed in 10 bits including
the 4-byte CRC.
2014-08-07 13:30:21 +02:00
Justin Ruggles
d7dbc687e3 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:52:01 +02:00
Michael Niedermayer
f0d56d4f55 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-25 23:15:58 +02:00
Michael Niedermayer
80588930ff 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-25 23:15:58 +02:00
Michael Niedermayer
6af1793dd5 Merge commit '9455a023be9f3915ccf5511a0b8fdb5b8897b2b6' into release/1.1
* commit '9455a023be9f3915ccf5511a0b8fdb5b8897b2b6':
  matroskaenc: do not write negative timestamps

Conflicts:
	tests/ref/lavf/mkv
	tests/ref/seek/lavf-mkv

No change to fate as ffmpeg was not affected by these bugs

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-20 00:48:51 +02:00
Anton Khirnov
9455a023be matroskaenc: do not write negative timestamps
Bug-Id: 597, 341
2014-06-01 12:51:40 +02:00
Michael Niedermayer
3d5c38ca7d 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-10 21:55:41 +02:00
Michael Niedermayer
8713b8e3fb avformat/mux: Check for and remove invalid packet durations
Fixes assertion failure
Fixes Ticket3575

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-10 21:55:41 +02:00
Michael Niedermayer
227ac71a60 Merge commit '696a74e81560889ef2fde76b045c5158a325a7a5' into release/1.1
* commit '696a74e81560889ef2fde76b045c5158a325a7a5':
  matroska: add the Opus mapping

Conflicts:
	libavformat/matroska.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-04 23:45:24 +02:00
Michael Niedermayer
d4e85004ec 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-05-04 22:55:46 +02:00
Michael Niedermayer
514917bf1c Merge commit '3938b6762132d3d7ef1b5782e7dc8bf73ac8145d' into release/1.1
* commit '3938b6762132d3d7ef1b5782e7dc8bf73ac8145d':
  mp3enc: Properly write bitrate value in XING header

Conflicts:
	libavformat/mp3enc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-04 22:49:00 +02:00
Michael Niedermayer
9ae26ef9c3 Merge commit 'eb89e1b98d3676aac1287d97c633b527c1ff4ea4' into release/1.1
* commit 'eb89e1b98d3676aac1287d97c633b527c1ff4ea4':
  oggdec: add support for Opus in Ogg demuxing

Conflicts:
	libavformat/oggparseopus.c
	libavformat/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-04 22:47:41 +02:00
Michael Niedermayer
d844179141 Merge commit 'b5f92f9603c2b46c37b20134e9e2338805844f0f' into release/1.1
* commit 'b5f92f9603c2b46c37b20134e9e2338805844f0f':
  isom: lpcm in mov default to big endian

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-04 22:26:11 +02:00
Anton Khirnov
696a74e815 matroska: add the Opus mapping
(cherry picked from commit 141fdc763c2841b572d29a2ad78513e8d5325870)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
(cherry picked from commit 79041d92ee7421853ee8c57fc13891cb0c272e0e)
2014-05-04 10:20:27 -04:00
Michael Niedermayer
3938b67621 mp3enc: Properly write bitrate value in XING header
Instead of using a fixed bitrate_idx, calculate a matching bitrate for
the XING header.

Using a fixed bitrate_idx causes tools such as file(1) and mediainfo(1)
to report wrong bitrate and bitrate mode when using CBR.

Bug-Id: https://bugs.debian.org/736088

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 617a1a98a6be3e59db6fbfc21afab2fb9a049c03)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
(cherry picked from commit 0f6e309b97e3da83a0fa75fbf1c4b50cd72047eb)
2014-05-04 10:18:14 -04:00
Nicolas George
eb89e1b98d oggdec: add support for Opus in Ogg demuxing
Fixes: https://bugzilla.libav.org/show_bug.cgi?id=603
Fixes: http://bugs.debian.org/720563

(cherry picked from commit ecab1c77410f023b437c6ed3a3281be8f039e574)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-05-03 12:08:04 -04:00
Mark Himsley
b5f92f9603 isom: lpcm in mov default to big endian
It is my understanding that "Unless otherwise stated, all data in a
QuickTime movie is stored in big-endian byte ordering" [1] in MOV files.

I have a couple of thousand files, which technically are invalid because
their sound sample description element 4CC is 'lpcm' but its version is
0 - and "Version 0 supports only uncompressed audio in raw ('raw ') or
twos-complement ('twos') format" [2]

Because isom.c only contains a mapping for 4CC 'lpcm' to
AV_CODEC_ID_PCM_S16LE, these files have their audio decoded as LE when
it is actually BE.

This commit adds AV_CODEC_ID_PCM_S16BE as the first match for 4CC 'lpcm'.

[1]
https://developer.apple.com/library/mac/documentation/quicktime/QTFF/qtff.pdf
page 21
[2]
https://developer.apple.com/library/mac/documentation/quicktime/QTFF/qtff.pdf
page 178

Reviewed-by: Yusuke Nakamura <muken.the.vfrmaniac@gmail.com>
(cherry picked from commit 360022bd3b894cc01ea112b275fa4c8f53881808)
(cherry picked from commit d37fac6dbbdddb76225aa691b83ffd9a0c7dae6b)
2014-05-03 12:06:08 -04:00
Baptiste Coudurier
42a8d32697 movdec: handle 0x7fff langcode as macintosh per the specs
The correct point that seperates ISO and MAC language codes is 0x400
according to the current QT spec. Old QT specs did not list where this
seperation is but apparently only defined the meaning of the first 137.

(cherry picked from commit 9e71cc81f3655cacf0f91860fba3043f13b64059)
(cherry picked from commit 7940306a47df602be4f57a62175706265bbfd0aa)
2014-05-03 12:06:08 -04:00
Michael Niedermayer
f30bd7c215 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-04-22 00:21:28 +02:00
Michael Niedermayer
238360665b Merge commit 'b77819afbc44016143b4a11b46109625203c4cef' into release/1.1
* commit 'b77819afbc44016143b4a11b46109625203c4cef':
  rtmpproto: Make sure to pass on the error code if read_connect failed

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 17:14:17 +02:00
Michael Niedermayer
6a35680195 Merge commit '03562c44c0c1e59d2a598390c5b2181ac406611c' into release/1.1
* commit '03562c44c0c1e59d2a598390c5b2181ac406611c':
  avi: Improve non-interleaved detection

Conflicts:
	libavformat/avidec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 16:50:32 +02:00
Michael Niedermayer
2ce46a959c Merge commit '9f7119b7fe003e94d72e81f3aa922568c2827dce' into release/1.1
* commit '9f7119b7fe003e94d72e81f3aa922568c2827dce':
  movenc: allow override of "writing application" tag

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 16:34:58 +02:00
Michael Niedermayer
8ca0d74d59 Merge commit 'd375d6395c0a5203932d89c087f77a5757a08138' into release/1.1
* commit 'd375d6395c0a5203932d89c087f77a5757a08138':
  matroskaenc: allow override of "writing application" tag

Conflicts:
	libavformat/matroskaenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 16:34:29 +02:00
Martin Storsjö
b77819afbc rtmpproto: Make sure to pass on the error code if read_connect failed
Previously, if read_connect failed, the ret variable was unmodified
and had the value 0, indicating success, which then was returned from
the rtmp_open function, even though it actually failed.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 6477139721f559b26eafd415e23e13ea2b0c27e1)
2014-04-15 23:20:07 -04:00
Michael Niedermayer
03562c44c0 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>
2014-04-14 22:31:48 -04:00
John Stebbins
9f7119b7fe movenc: allow override of "writing application" tag
Signed-off-by: Tim Walker <tdskywalker@gmail.com>

CC: libav-stable@libav.org
(cherry picked from commit 565e0c6d866ce08d4b06427456d3d1f4fd856e9c)
2014-04-14 18:34:29 -04:00
John Stebbins
d375d6395c matroskaenc: allow override of "writing application" tag
Signed-off-by: Tim Walker <tdskywalker@gmail.com>

CC: libav-stable@libav.org
(cherry picked from commit 0092c1dd8dac2d9e185b58503b447a0d3fb5230d)
2014-04-14 18:33:03 -04:00
Michael Niedermayer
c6f2ad9f94 avformat/mov: fix keyframe flags for sample from chromium Issue 340865
Fixes ticket #3362.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a0911b059763b8f13c70adcbbe71e10382855104)
2014-03-24 23:38:13 +01:00
Hendrik Leppkes
cf4099161a avformat/mov: only force parsing for video tracks if stss is empty
Fixes playback of some AAC streams, which are otherwise mangled by the
parser, and stss is typically only valid for video anyway.

Fixes a regression since e41ea866.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 019247bdc326a90bf20d3ce5d2413cc642e8bb08)
2014-03-24 23:38:10 +01:00
Michael Niedermayer
694c3a13c9 avformat/mpegtsenc: Check data array size in mpegts_write_pmt()
Prevents out of array writes

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

Conflicts:

	libavformat/mpegtsenc.c
(cherry picked from commit e87de3f50b765134588d0b048c32ed4b8acc16fb)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-07 04:04:07 +01:00
Michael Niedermayer
08dde7567d Merge remote-tracking branch 'qatar/release/9' into release/1.1
* qatar/release/9:
  Update Changelog for 9.11
  oggparseogm: check timing variables
  mathematics: remove asserts from av_rescale_rnd()
  vc1: Always reset numref when parsing a new frame header.
  h264: reset num_reorder_frames if it is invalid

Conflicts:
	Changelog
	libavcodec/vc1.c
	libavutil/mathematics.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-04 06:41:15 +01:00
Michael Niedermayer
cb8180885f Merge commit '62ed6da016b789eee00e0fff517df4a254e12e5d' into release/1.1
* commit '62ed6da016b789eee00e0fff517df4a254e12e5d':
  h264: check that an IDR NAL only contains I slices
  mov: Free an earlier allocated array if allocating a new one

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-04 06:32:48 +01:00
Michael Niedermayer
e2781db62a Merge commit '44079902c49e526f464bb4eb855665e1af867e91' into release/1.1
* commit '44079902c49e526f464bb4eb855665e1af867e91':
  mov: Free intermediate arrays in the normal cleanup function
  segafilm: fix leaks if reading the header fails
  h264_cavlc: check the size of the intra PCM data.
  h263: Check init_get_bits return value
  cavsdec: check ff_get_buffer() return value

Conflicts:
	libavcodec/cavsdec.c
	libavcodec/h263dec.c
	libavformat/mov.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-04 06:23:46 +01:00
Michael Niedermayer
9ac7d8f85d Merge commit 'c85e5f13f6ac9c4c90125e7671d89009e57f9df9' into release/1.1
* commit 'c85e5f13f6ac9c4c90125e7671d89009e57f9df9':
  cavs: Check for negative cbp
  avi: DV in AVI must be considered single stream
  vmnc: Check the cursor dimensions
  vmnc: Port to bytestream2

Conflicts:
	libavcodec/cavsdec.c
	libavcodec/vmnc.c
	libavformat/avidec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-04 06:05:36 +01:00
Michael Niedermayer
a5c3f596d1 avformat/utils: av_probe_input_buffer2 decrease difference to libav
This removes the initialization of 2 unused fields
The change was part of c1868e7ee7b07b40a0fe15f50df89fe499a01a50
but wasnt merged as the fields could still be used

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

Conflicts:

	libavformat/utils.c
2014-02-04 05:20:43 +01:00
Michael Niedermayer
ee3ce73bfb avformat/utils/av_probe_input_buffer2: fix buffer passed to ffio_rewind_with_probe_data()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 05886c9d4edddb07a4cdc6afee8b30cd9c80b4db)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-04 05:20:09 +01:00
Michael Niedermayer
3994eebb1e avformat/utils/av_probe_input_buffer2: fix offset check
The check could fail if avio_read() read less than requested

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-04 05:20:08 +01:00
Michael Niedermayer
82b44665e9 avformat/utils/av_probe_input_buffer2: Fix pd.buf_size
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6a2064820b52568c05a9ec8f418f18840e7c43cc)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-04 05:20:07 +01:00
Michael Niedermayer
35bf91c5b5 Merge commit '8575f5362f98c937758b20ff8512d6767a56208e' into release/1.1
* commit '8575f5362f98c937758b20ff8512d6767a56208e':
  lavf: make av_probe_input_buffer more robust
  lavf: use a fixed width type
  lavf: simplify handling of offset in av_probe_input_buffer()

Conflicts:
	libavformat/utils.c

See: cdce0e8a506cafebe47736d891f5b645b57d14b2 and previous commits
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-04 05:17:57 +01:00
Michael Niedermayer
c06f8bac20 avformat/utils: fix av_probe_input_buffer2() so it returns the probe score
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c4810fbe4f53d312ba70f251f7ee4f484cbca565)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-04 05:15:36 +01:00
Anton Khirnov
bf7c240a50 oggparseogm: check timing variables
Fixes a potential divide by zero.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
(cherry picked from commit 75647dea6f7db79b409bad66a119f5c73da730f3)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-02-01 23:51:46 -05:00
Martin Storsjö
44079902c4 mov: Free intermediate arrays in the normal cleanup function
These arrays are normally freed at the end of mov_read_trak,
but make sure they're freed in case mov_read_trak returned
early (due to errors) or in case the atoms that allocate arrays
are encountered at some other point than within a trak (which
we don't have checks against).

Sample-Id: 00000496-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit d51f09962d5b4bc999fb70c040f330dd1873212e)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-02-01 23:51:45 -05:00
Martin Storsjö
a1b4d42d31 mov: Free an earlier allocated array if allocating a new one
It could probably also be considered an error if the pointer isn't
null at this point, but then we might risk rejecting some
slightly broken files that we might have handled so far.

Sample-Id: 00000496-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 2620df13104ddaa136158eb6bb1195adbf9d7692)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-02-01 23:51:45 -05:00