1316 Commits

Author SHA1 Message Date
Michael Niedermayer
bbef5b0b86 avformat/utils: Fix number suffixes in tb_unreliable()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4b15bba2aec93776bfdc69a1bca42a4795a7d191)

Conflicts:

	libavformat/utils.c
(cherry picked from commit e651a2f88c219e74c9851563e74100f7652a6005)
2015-03-13 17:06:09 +01: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
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
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
f401e60063 avformat/utils: dont count attached pics toward the probesize
Such pics behave more like headers which we also dont count.
Fixes Ticket3146

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a8dec360c5db15e8da4b44ff3c0f02a6c57e8ac0)
2013-11-18 15:15:37 +01:00
Michael Niedermayer
4c17e20ff0 avformat/utils: do not override pts in h264 when they are provided from the demuxer
Fixes Ticket2143

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1e5271a9fd6ddcceb083f2185a4bbd8d44c9a813)
2013-10-27 19:45:15 +01:00
Michael Niedermayer
5da68aff96 Merge commit '04d2f9ace3fb6e880f3488770fc5a39de5b63cbb' into release/1.1
* commit '04d2f9ace3fb6e880f3488770fc5a39de5b63cbb':
  mvi: Add sanity checking for the audio frame size
  alac: Do bounds checking of lpc_order read from the bitstream
  xwma: Avoid division by zero
  avidec: Make sure a packet is large enough before reading its data
  vqf: Make sure the bitrate is in the valid range
  vqf: Make sure sample_rate is set to a valid value
  electronicarts: Check packet sizes before reading
  lavf: Avoid setting avg_frame_rate if delta_dts is negative
  vc1dec: Undo mpegvideo initialization if unable to allocate tables
  vc1dec: Fix leaks in ff_vc1_decode_init_alloc_tables on errors
  wnv1: Make sure the input packet is large enough
  dcadec: Validate the lfe parameter

Conflicts:
	libavcodec/dcadec.c
	libavcodec/wnv1.c
	libavformat/avidec.c
	libavformat/electronicarts.c
	libavformat/utils.c
	libavformat/xwma.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-08 01:26:51 +02:00
Martin Storsjö
17e7edf75b lavf: Avoid setting avg_frame_rate if delta_dts is negative
This avoids setting avg_frame_rate to invalid (negative)
values.

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 ce67f442be0f6c4a8794272873852e256b5b8ee4)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-04 03:26:29 +02:00
Michael Niedermayer
bf31271478 Merge remote-tracking branch 'qatar/release/9' into release/1.1
* qatar/release/9:
  Update Changelog
  Prepare for 9.9 RELEASE
  lavf: fix the comparison in an overflow check
  dv: Add a guard to not overread the ppcm array
  nuv: check ff_rtjpeg_decode_frame_yuv420 return value

Conflicts:
	Changelog
	RELEASE
	libavformat/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-09 09:10:20 +02:00
Michael Niedermayer
5c6aea5c31 avformat/utils: Fix bitrate overflow check
The check added in df33a58e5311ee9a64a573889b883a80e981af7b does not work
at all, rather it broke the summing of bitrates completely.
The comparission was wrong way around.
This commit replaces it by a simpler and hopefully clearer check

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

Conflicts:

	libavformat/utils.c

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-07 13:51:58 +02:00
Michael Niedermayer
dfe0ba46bf Merge commit 'aade60ab165716523788cd11caf03ae61b40144a' into release/1.1
* commit 'aade60ab165716523788cd11caf03ae61b40144a':
  matroskadec: Check that .lang was allocated and set before reading it
  alac: Limit max_samples_per_frame
  ape demuxer: check for EOF in potentially long loops
  4xm: check that bits per sample is strictly positive
  lavf: avoid integer overflow when estimating bitrate
  pictordec: pass correct context to avpriv_request_sample

Conflicts:
	libavcodec/pictordec.c
	libavformat/matroskadec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-07 13:49:23 +02:00
Anton Khirnov
777bc81a91 lavf: fix the comparison in an overflow check
CC: libav-stable@libav.org

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 26f027fba1c5ab482fa2488fbe0fa36c8bb33b69)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-09-07 12:09:58 +02:00
Anton Khirnov
4cb3efc206 lavf: avoid integer overflow when estimating bitrate
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit df33a58e5311ee9a64a573889b883a80e981af7b)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-09-07 10:15:00 +02:00
Michael Niedermayer
0930a562e7 Merge commit '0b6adcf76bda8994902f5b6d8e694b0b916ea210' into release/1.1
* commit '0b6adcf76bda8994902f5b6d8e694b0b916ea210':
  oma: refactor seek function
  xl: Make sure the width is valid
  8bps: Bound-check the input buffer
  4xm: Reject not a multiple of 16 dimension
  alsdec: Clean up error paths
  alsdec: Fix the clipping range
  dsicinav: Clip the source size to the expected maximum
  dsicinav: Bound-check the source buffer when needed
  dsicinav: K&R formatting cosmetics
  lavf: Make sure avg_frame_rate can be calculated without integer overflow
  mov: Do not allow updating the time scale after it has been set
  mov: Seek back if overreading an individual atom
  ac3dec: Don't consume more data than the actual input packet size
  indeo: Reject impossible FRAMETYPE_NULL
  indeo: Do not reference mismatched tiles

Conflicts:
	libavcodec/4xm.c
	libavcodec/8bps.c
	libavcodec/alsdec.c
	libavcodec/dsicinav.c
	libavcodec/ivi_common.c
	libavcodec/xl.c
	libavformat/mov.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-27 18:29:55 +02:00
Martin Storsjö
dc556d8bf7 lavf: Make sure avg_frame_rate can be calculated without integer overflow
If either of the deltas is too large for the multiplications to
succeed, don't use this for setting the avg frame rate.

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 e740929a071ab032ffa382e89da69c6ec7cf882c)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 12:12:26 +02:00
Dale Curtis
406632d1ef avformat/utils: Keep internal and external av_read_frame() packets in sync.
Otherwise, during error conditions, the caller will be left with
dangling pointers to a destructed packet => boom.

BUG=242786
TEST=ffmpeg_regression_tests

Commit slightly simplified by commiter
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c54a1565f512858ccfa70392f40f11c098bc1b63)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-06-02 23:29:52 +02:00
Michael Niedermayer
2416eff5b9 ff_read_timestamp: check stream_index before using it as array index
Fixes out of array read

Fixes ticket #2609.

Found-by: durandal_1707
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 695a766bff4cd8414a84e58159506d72b4e44892)
2013-05-30 11:05:58 +02:00
Michael Niedermayer
a367ab657f Merge commit '8f558c3e101859aec9adcb4b4b270ae1ef8f88b5' into release/1.1
* commit '8f558c3e101859aec9adcb4b4b270ae1ef8f88b5':
  af_channelmap: sanity check input channel indices in all cases.
  id3v2: pad the APIC packets as required by lavc.
  lavf: make sure stream probe data gets freed.
  dfa: check for invalid access in decode_wdlt().

Conflicts:
	libavformat/id3v2.c
	libavformat/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-12 13:35:30 +02:00
Anton Khirnov
094a35aeef lavf: make sure stream probe data gets freed.
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit dbb1425811a672eddf4acf0513237cdf20f83756)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-04-06 11:48:10 +02:00
Michael Niedermayer
b642e45d8c avformat: Fix apics with aac
Fixes Ticket2318

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cada996528422907b8b818e99029a8e3b97cf08d)
2013-03-07 14:57:09 +01:00
Michael Niedermayer
2713e43ac8 ff_get_audio_frame_size: try to fix wma in wav
Fixes Ticket1905, Ticket2114

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-06 19:46:04 +01:00
Carl Eugen Hoyos
c52e07bb6e Fix AVCI50 SPS to specify a SAR of 4:3 instead of 3:4. 2013-01-05 09:20:03 +01:00
Reimar Döffinger
c5142a95a5 Support more AVC-Intra files
Followup to http://thread.gmane.org/gmane.comp.video.ffmpeg.devel/151321
patch by Reimar and Thomas Mundt fixes some AVC-Intra files from
different tickets.
It does not fix http://samples.ffmpeg.org/ffmpeg-
bugs/trac/ticket524/AVCI50.mov

Authors of this commit are: Reimar and Thomas Mundt
Patch and commit message mostly taken from ffmpeg-devel, mail by Carl
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-03 21:48:38 +01:00
Michael Niedermayer
bbb11f383e lavf: add return to silence compiler warning
The added statement is not reachable

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-03 20:02:14 +01:00
Clément Bœsch
491ca0e89f Replace references to "que" with the appropriate word.
"que" sounds like a slang word to me. This commit renames a few
variables, fix the comments and the logging messages (sometimes along
with small other typo fixes).
2013-01-03 00:21:47 +01:00
Michael Niedermayer
98db905896 avformat_seek_file: Dont attempt to rescale INT64_MIN/MAX
This fixes a integer overflow in fate

Reviewed-by: Clément Bœsch <ubitux@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-03 00:02:22 +01:00
Michael Niedermayer
aa86d2d884 lavf: move stream==-1 handling from ff_subtitles_queue_seek() to avformat_seek_file()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-02 23:02:33 +01:00
Michael Niedermayer
341e40f1e1 lavf: Fix codec id forcing with probed codecs
Fixes Ticket2088

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-02 01:17:36 +01:00
Michael Niedermayer
3a6b6f425e lavf: move force_codec_ids() up
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-02 01:17:36 +01:00
Michael Niedermayer
63753186cc lavf: Remove "Adjusting PTS forward" code
it causes problems (incorrectly detect TS discontinuities)
 with a brokan TS file (test-audio-broken.ts)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-21 05:12:05 +01:00
Michael Niedermayer
1166fc07a2 utils: fix duration calculation for strange_duration_example.ts
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-19 04:16:15 +01:00
Michael Niedermayer
1e901ffc61 wrap_timestamp: remove unneeded check
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-16 01:07:53 +01:00
Michael Niedermayer
1662bd350a lavf: fix integer overflows
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-16 01:05:36 +01:00
Harald Axmann
2d74dea84f lavf: Provide a monotonic timestamp to the outside world
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-15 21:28:45 +01:00
Michael Niedermayer
67c1b5b026 lavf: remove unneeded pb check
Fixes CID747727
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-11 09:34:47 +01:00
Michael Niedermayer
a70b38d2dd lavf: fix memleak
Fixes CID747738
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-11 08:51:34 +01:00
Michael Niedermayer
20899c54f0 http/utils: rename "demuxer" to mime_type
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-10 01:00:16 +01:00
Michael Niedermayer
68bc012190 http/utils: move mime -> demuxer maping from http to utils
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-09 20:24:49 +01:00
Michael Niedermayer
e3d95b54db probe: belive protocol content type if set and avoid lengthly probing.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-09 19:12:34 +01:00
Mans Rullgard
91ac403b13 lavf: fix arithmetic overflows in avformat_seek_file()
The values compared here can be more than INT64_MAX apart.  Since the
difference is always positive, converting to uint64_t before subtracting
gives the correct result without overflows.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-12-08 19:35:16 +00:00
Michael Niedermayer
99efd59626 Merge commit 'cb45553f577f8e0ebfe05d3287e1b6fa5859b967'
* commit 'cb45553f577f8e0ebfe05d3287e1b6fa5859b967':
  Remove pointless #undefs of previously forbidden functions.
  fate: Add dependencies for bmp, cdxl, dfa, mp3

Conflicts:
	doc/examples/muxing.c
	libavfilter/filtfmts.c
	libavutil/des.c
	libavutil/eval.c
	libavutil/log.c
	libavutil/parseutils.c
	tests/fate/mp3.mak

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-05 13:34:45 +01:00
Anton Khirnov
cb45553f57 Remove pointless #undefs of previously forbidden functions. 2012-12-04 21:40:22 +01:00
Nicolas George
03847eb825 lavf: compute probe buffer size more reliably.
The previous code computes the offset by reversing the growth
of the allocated buffer size: it is complex and did lead to
inconsistencies when the size limit is reached.

Fix trac ticket #1991.
2012-12-04 19:49:51 +01:00