50851 Commits

Author SHA1 Message Date
Michael Niedermayer
fe97363c38 swresample/dither: use av_malloc_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a5290cb1ac047851563da7aca06569e3ada55f79)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-23 18:16:20 +02:00
Michael Niedermayer
ce95904013 swresample/resample: Limit filter length
Related to CID1197063

The limit choosen is arbitrary and much larger than what makes sense.
It avoids the need for checking arithmetic operations with the length for overflow

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-23 18:16:20 +02:00
Michael Niedermayer
a61998e4f4 avcodec/msrle: check return code for success before use
The check is possibly redundant, but better to check for errors
that dont occur than to skip the check and crash

Fixes CID1197060

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-23 18:16:20 +02:00
Michael Niedermayer
e5546d4871 avcodec/wma: use av_freep(), do not leave stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d167faafe9dfa0b82bebb267c3c4e5fa5286bd67)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-23 18:16:20 +02:00
Lukasz Marek
8f7ebb88b8 lavu/opt: validate range before dereference
This change make error handling simplier.
av_opt_freep_ranges may be called when some ranges are NULL,
for example after memory allocation fail.

Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3aac5fcfa9d3748659d78ab2a66d0ccce22cfd4f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-23 18:16:20 +02:00
Michael Niedermayer
e897eb108b avcodec/libx264: move where x264opts is applied down so it isnt overridden by avctx & defaults
fixes x264opts opengop=1

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-23 18:16:20 +02:00
Michael Niedermayer
2af3a04164 avcodec/h264_mp4toannexb_bsf: prepend global headers before any in stream parameter sets
Fixes h264_mp4toannexb_bsf_failure.mkv

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-23 18:16:20 +02:00
Michael Niedermayer
92ca3578bf avcodec/x86/mpegvideoenc_template: fix integer overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-23 18:16:20 +02:00
Michael Niedermayer
1be06c8531 swscale/swscale: fix integer overflow
Should fix fate failure with clang ftrapv

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-23 18:16:20 +02:00
Carl Eugen Hoyos
6011b806dd Show duration for large asf files as written in the file header.
Fixes ticket #3428.
(cherry picked from commit e3fd263f0b73e4425192d6dd1ab18027ecaa35db)
2014-06-21 23:08:55 +02:00
Carl Eugen Hoyos
3ac85d70f0 Revert two backports to release/1.2 that broke fate.
Revert "ff_id3v2_read: add option to limit ID3 magic number search"
Revert "ff_id3v2_free_extra_meta: set the pointer pointing to extra_meta to NULL"

This reverts commit 7f8aa37bc3666d060b3eb2baa02fcea3597a22fd.
This reverts commit 5219e20d58e15305e188ba60a75bfc37a1f82341.
2014-06-20 01:58:14 +02:00
Martin Storsjö
401b3dafd9 adpcm: Write the proper predictor in trellis mode in IMA QT
The actual predictor value, set by the trellis code, never
was written back into the variable that was written into
the block header. This was accidentally removed in b304244b.

This significantly improves the audio quality of the trellis
case, which was plain broken since b304244b.

Encoding IMA QT with trellis still actually gives a slightly
worse quality than without trellis, since the trellis encoder
doesn't use the exact same way of rounding as in
adpcm_ima_qt_compress_sample and adpcm_ima_qt_expand_nibble.

Fixes part of Ticket3701

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

Conflicts:
	tests/ref/acodec/adpcm-ima_qt-trellis
2014-06-10 00:24:30 +02:00
Martin Storsjö
71516ac175 adpcm: Fix trellis encoding of IMA QT
This was broken in 095be4fb - samples+ch (for the previous
non-planar case) equals &samples_p[ch][0]. The confusion
probably stemmed from the IMA WAV case where it originally
was &samples[avctx->channels + ch], which was correctly
changed into &samples_p[ch][1].

Fixes part of Ticket3701

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a32765c4252eb106a2ade543026ef6f59e699bfa)
2014-06-10 00:24:22 +02:00
Carl Eugen Hoyos
0983720cf2 avcodec/utvideodec: Increase vlc len
Fixes a regression since fb3e380 similar to ticket #2661,
reported by fluffrabbit at aol dot com.

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

Conflicts:
	libavcodec/utvideodec.c
2014-06-10 00:21:05 +02:00
Michael Niedermayer
9e9d92bbcc 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)

Conflicts:
	libavformat/avidec.c
2014-06-10 00:18:22 +02:00
Michael Niedermayer
3d79041f85 sws: dont use the optimized 410->420 unscaled conversion when height%4
Fixes Ticket3594
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 421b21ca8a02a346ba03cea3bb2ecc33f791fc30)
2014-05-01 18:32:45 +02:00
Michael Niedermayer
2c71734d9e avcodec/vorbisdec: try to workaround libvorbisenc bug
Fixes Ticket3590

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

Conflicts:
	libavcodec/vorbisdec.c
2014-05-01 18:32:13 +02:00
Stefano Sabatini
0759bdc315 ffprobe: fix scaling of vali in value_string() in case -prefix is selected
Fix trac ticket #3523.
(cherry picked from commit 1ba59b1cbeafe7cd28db04f772abd89eb7e4ce1e)
2014-04-23 17:22:49 +02:00
Michael Niedermayer
1530fbccac avformat/avidec: Speed up keyframe detection code
Fixes Ticket3531

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

Conflicts:
	libavformat/avidec.c
2014-04-23 17:22:06 +02:00
Peter Ross
7f8aa37bc3 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>
(cherry picked from commit 5331773cc33ba26b9e26ace643d926219e46a17b)

Conflicts:
	libavformat/dsfdec.c
	libavformat/id3v2.c
2014-04-19 13:28:22 +02:00
Peter Ross
5219e20d58 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>
(cherry picked from commit c94305ae23318c8956a30485cd5642829f4f16a9)
2014-04-19 13:20:04 +02:00
Michael Niedermayer
8ee704c392 avformat/matroskadec: support SVQ3 as generated by mkvtoolnix-6.6.0
Fixes part of Ticket3256

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

Conflicts:
	libavformat/matroskadec.c
2014-04-16 19:51:51 +02:00
Michael Niedermayer
9060c10c65 avformat/matroskaenc: wrap V_QUICKTIME codec private in something that looks like its part of quicktime stsd
This is needed for matroska spec compliance
Fixes playback of SVQ3 in matroska with vlc
Fixes Ticket 3256

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8456bd2c0f3b08756f353646fe3b40a6772e665e)
2014-04-16 19:46:38 +02:00
Michael Niedermayer
5202621ac4 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:30:34 +01:00
Hendrik Leppkes
da6a8c9cfd 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:30:09 +01:00
Michael Niedermayer
f07cebcd91 avcodec/h263dec: Fix use of uninitialized memory from the bitstream buffer
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-18 18:06:17 +01:00
Michael Niedermayer
d0ba12fa0c swscale/x86/swscale: fix missing xmm clobbers in yuv2yuvX_sse3()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6c47a4e972485e5f0c812159373f703c6f1d089f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-18 17:07:58 +01:00
Michael Niedermayer
a58053dc24 avutil/timestamp: Warn about missing __STDC_FORMAT_MACROS for C++ use
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8b02dfd37cb3bc9521fc6e1f5b5f13c80d144cd2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-18 17:07:58 +01:00
Peter Ross
b1a960cc83 avcodec/adpcm: squelch 'mismatch in coded sample count' warning for AV_CODEC_ID_ADPCM_EA_R2/3
These ADPCM codecs include a per-frame flag that enables a raw 16-bit mode. Therefore
the the number of samples returned by get_nb_samples() is only ever approximate.

Fixes ticket #3460.

Signed-off-by: Peter Ross <pross@xvid.org>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7380201451a2edfb240cd356579c4c39a87cf5bd)
2014-03-17 16:06:20 +01:00
Peter Ross
620d80d572 avcodec/adpcm: ADPCM_IMA_DK3 packets are padded to 16-bit packet boundary
Fixes ticket #3461.

Signed-off-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d1bb17940dd242e56541775318636bcbe3eab73d)
2014-03-17 16:06:09 +01:00
Michael Niedermayer
e3ce3d373c avcodec/h264: be more tolerant on what pixel format changes trigger reinits
Fixes Ticket3260

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

Conflicts:
	libavcodec/h264.c
2014-03-17 16:06:04 +01:00
Michael Niedermayer
f31682f2f2 avformat/flvdec: discard inconsistent timestamps
Fixes Ticket3425

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

Conflicts:
	libavformat/flvdec.c
2014-03-13 07:37:58 +01:00
Michael Niedermayer
fb44a3e4a3 avcodec/vorbisdec: use the stored previous window type only when the actual previous is not known
Fixes Ticket3432

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5171ae781a240cac3860c20f9aefc6d1b2c61cac)
2014-03-13 07:35:17 +01:00
Michael Niedermayer
6ee47bd008 Merge remote-tracking branch 'TimothyGu/release/1.2' into release/1.2
* TimothyGu/release/1.2:
  configure: use pkg-config to detect libbluray

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-10 13:15:42 +01:00
Luca Barbato
7819750157 avidec: Let the inner dv demuxer take care of discarding
Fixes ticket #1796.
(cherry picked from commit c8f0b20b4a6bb6691928789d83e4b02896969848)

Conflicts:
	libavformat/avidec.c
2014-03-09 14:05:17 +01:00
Timothy Gu
0d819ed318 configure: use pkg-config to detect libbluray
The current configure fails when static libbluray is compiled with libxml2
support.

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit baa650cc7946a9eb1cf5a083f61a581a97122f03)
Signed-off-by: Timothy Gu <timothygu99@gmail.com>

Conflicts:
	configure
2014-03-06 17:55:46 -08:00
Michael Niedermayer
e63346f7e8 update for 1.2.6
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
n1.2.6
2014-03-05 03:55:25 +01:00
Michael Niedermayer
ddcccababe avcodec/utvideoenc: fix slice_bits size
Fixes assertion failure

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

Conflicts:

	libavcodec/utvideoenc.c
(cherry picked from commit 57522ca79cc38c279123596d3288ddbf56fa8903)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-05 03:06:10 +01:00
Michael Niedermayer
b580bae53a avcodec/snow: split block clipping checks
Fixes out of array read
Fixes: d4476f68ca1c1c57afbc45806f581963-asan_heap-oob_2266b27_8607_cov_4044577381_snow_chroma_bug.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 61d59703c91869f4e5cdacd8d6be52f8b89d4ba4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-05 03:06:10 +01:00
Michael Niedermayer
9085cdd677 avcodec/ansi: fix integer overflow
Fixes out of array read
Fixes: 5f9698e86d92f19bb08d54ff0d57027f-signal_sigsegv_b30756_3795_cov_2693691257_ansi256.ans
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d42ec8433c687fcbccefa51a7716d81920218e4f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-05 03:06:10 +01:00
Michael Niedermayer
ab31a9ee4a avcodec/msrle: use av_image_get_linesize() to calculate the linesize
Fixes out of array access
Fixes: 14a74a0a2dc67ede543f0e35d834fbbe-asan_heap-oob_49572c_556_cov_215466444_44_001_engine_room.mov
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c919e1ca2ecfc47d796382973ba0e48b8f6f92a2)

Conflicts:

	libavcodec/msrle.c
(cherry picked from commit bc1c8ec5e65098fd2ccd8456f667151dfc9cda42)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-05 03:06:10 +01:00
Michael Niedermayer
a57d29a50c 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-05 03:06:10 +01:00
Michael Niedermayer
11b14d0e63 avcodec/wmalosslessdec: fix mclms_coeffs* array size
Fixes corruption of context
Fixes: 8835659dde6a4f7dcdf341de6a45c6c8-signal_sigsegv_1dce67b_4564_cov_2504444599_classical_22_16_1_14000_v3c_0_extend_0_29.wma
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ec9578d54d09b64bf112c2bf7a34b1ef3b93dbd3)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-05 03:06:10 +01:00
Justin Ruggles
bb683ebdba samplefmt: avoid integer overflow in av_samples_get_buffer_size()
CC:libav-stable@libav.org
(cherry picked from commit 0e830094ad0dc251613a0aa3234d9c5c397e02e6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-05 03:06:10 +01:00
Michael Niedermayer
b3cc4bd18f avcodec/vc1: reset fcm/field_mode in non advanced header parsing
Fixes NULL pointer dereference
Fixes: signal_sigsegv_1ab8bf4_2847_cov_4254117347_SA10091.vc1
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b51e9354772de446e8196dabf9aad1567b22f74d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-05 03:06:10 +01:00
Michael Niedermayer
ca9d302519 avcodec/takdec: always check bits_per_raw_sample
Fixes out of array access
Fixes: asan_heap-oob_19c7a94_6470_cov_1453611734_luckynight-partial.tak
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f58eab151214d2d35ff0973f2b3e51c5eb372da4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-05 03:06:10 +01:00
Michael Niedermayer
e925fd215f avcodec/vmnc: Check that rectangles are within the picture
Prevents out of array accesses with CODEC_FLAG_EMU_EDGE

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

Conflicts:

	libavcodec/vmnc.c

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-05 03:06:10 +01:00
Michael Niedermayer
5e01cd3b69 dnxhdenc: fix mb_rc size
Fixes out of array access with RC_VARIANCE set to 0

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-05 03:06:10 +01:00
Anton Khirnov
2256b2a3c1 pthread_frame: flush all threads on flush, not just the first one
avcodec_flush_buffers() must release all internally held references
according to its documentation, for which all the threads need to be
flushed.

Bug-Id: vlc/9665
(cherry picked from commit d1f9563d502037239185c11578cc614bdf0c5870)

Conflicts:
	libavcodec/pthread_frame.c
2014-03-04 01:39:11 +01:00
Martin Storsjö
89c917fcd9 rtpdec_asf: Copy the need_parsing field from the chained demuxer
This fixes playback of mp3 streams in rtp/asf. This used to work
until 950482bf, but mostly by coincidence.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 2aec9e228cb317cca8cda9e03986c8482ea54404)

Fixes ticket #3223
2014-01-27 15:48:27 +01:00