12348 Commits

Author SHA1 Message Date
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
Anton Khirnov
f728782c0d segafilm: fix leaks if reading the header fails
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
(cherry picked from commit 6892d145a0c80249bd61ee7dd31ec851c5076bcd)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-02-01 23:51:45 -05:00
Luca Barbato
3485a07977 avi: DV in AVI must be considered single stream
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2014-02-01 14:59:50 -05:00
Anton Khirnov
8575f5362f lavf: make av_probe_input_buffer more robust
Always use the actually read size as the offset instead of making
possibly invalid assumptions.

Addresses: CVE-2012-6618

(cherry picked from commit 2115a3597457231a6e5c0527fe0ff8550f64b733)

Conflicts:
	libavformat/utils.c

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-01-13 15:32:24 +01:00
Anton Khirnov
539d255871 lavf: use a fixed width type
It's shorter and more consistent with the rest of the code.

(cherry picked from commit 8b76362836f3c373c3aadc544522edcbef16dd5f)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-01-13 15:32:17 +01:00
Anton Khirnov
e38c62fe0c lavf: simplify handling of offset in av_probe_input_buffer()
(cherry picked from commit c1868e7ee7b07b40a0fe15f50df89fe499a01a50)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-01-13 15:24:08 +01:00
Michael Niedermayer
f479c17894 Merge commit '65830277d2d2ee3658e1f070a61044fff261ed3e' into release/1.1
* commit '65830277d2d2ee3658e1f070a61044fff261ed3e':
  prores: Add a codepath for decoding errors
  nut: Fix unchecked allocations
  avi: directly resync on DV in AVI read failure
  mov: Don't allocate arrays with av_malloc that will be realloced
  shorten: Extend fixed_coeffs to properly support pred_order 0
  Prepare for 9.11 RELEASE
  avi: properly fail if the dv demuxer is missing
  prores: Reject negative run and level values
  audio_mix: fix channel order in mix_1_to_2_fltp_flt_c
  indeo4: Check the inherited quant_mat

Conflicts:
	RELEASE
	libavcodec/indeo4.c
	libavcodec/shorten.c
	libavformat/nut.c
	libavformat/nutdec.c
	libavformat/nutenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-12 16:51:26 +01:00
Michael Niedermayer
c693ccb89a Merge commit '7b337b122959b9bf634c31b549892df974f35b40' into release/1.1
* commit '7b337b122959b9bf634c31b549892df974f35b40':
  truemotion1: make sure index does not go out of bounds
  pcx: round up in bits->bytes conversion in a buffer size check
  omadec: Fix wrong number of array elements
  omadec: check GEOB sizes against buffer size
  ac3dec: fix outptr increment.
  avio: Use AVERROR_PROTOCOL_NOT_FOUND

Conflicts:
	libavcodec/ac3dec.c
	libavcodec/pcx.c
	libavformat/omadec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-12 16:16:58 +01:00
Michael Niedermayer
7e34379897 Merge commit '0e8ae6d10c609bb968c141aa2436413a55852590' into release/1.1
* commit '0e8ae6d10c609bb968c141aa2436413a55852590':
  mpegvideo: Drop a faulty assert
  lavr: check that current_buffer is not NULL before using it
  pmpdec: check that there is at least one audio packet.
  lzw: switch to bytestream2
  gifdec: convert to bytestream2

Conflicts:
	libavcodec/gifdec.c
	libavcodec/lzw.c
	libavcodec/lzw.h
	libavformat/pmpdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-12 16:08:27 +01:00
Michael Niedermayer
ce795ac0f5 Merge commit 'c5c7e3e6f7cf17943c04bd078f260eaf789afbc9' into release/1.1
* commit 'c5c7e3e6f7cf17943c04bd078f260eaf789afbc9':
  gifdec: check that the image dimensions are non-zero
  gifdec: return meaningful error codes.
  eacmv: check the framerate before setting it.
  rv30: fix extradata size check.
  sdp: Check that fmt->oformat is non-null before accessing it
  matroskadec: use correct compression parameters for current track CodecPrivate
  vc1: Reset numref if fieldmode is not set

Conflicts:
	libavcodec/gifdec.c
	libavcodec/rv30.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-12 15:48:39 +01:00