OSDN Git Service

android-x86/external-ffmpeg.git
9 years agoMerge tag 'n2.1.6' of git://source.ffmpeg.org/ffmpeg into kitkat-x86 android-x86-4.4-r2
Chih-Wei Huang [Wed, 31 Dec 2014 07:36:20 +0000 (15:36 +0800)]
Merge tag 'n2.1.6' of git://source.ffmpeg.org/ffmpeg into kitkat-x86

FFmpeg 2.1.6 release

9 years agoUpdate for 2.1.6
Michael Niedermayer [Fri, 28 Nov 2014 19:04:28 +0000 (20:04 +0100)]
Update for 2.1.6

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/svq3: Dont memcpy AVFrame
Michael Niedermayer [Fri, 3 Oct 2014 22:13:26 +0000 (00:13 +0200)]
avcodec/svq3: Dont memcpy AVFrame

This avoids out of array accesses

Fixes: asan_heap-uaf_21f42e4_9_asan_heap-uaf_21f42e4_278_gl2.mov

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/hevc_ps: Check num_long_term_ref_pics_sps
Michael Niedermayer [Fri, 28 Nov 2014 02:46:56 +0000 (03:46 +0100)]
avcodec/hevc_ps: Check num_long_term_ref_pics_sps

Fixes out of array access
Fixes: signal_sigsegv_35bd0f0_1182_cov_791726764_STRUCT_B_Samsung_4.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ea38e5a6b75706477898eb1e6582d667dbb9946c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/rawdec: Check the return code of avpicture_get_size()
Michael Niedermayer [Wed, 26 Nov 2014 17:56:39 +0000 (18:56 +0100)]
avcodec/rawdec: Check the return code of avpicture_get_size()

Fixes out of array access
Fixes: asan_heap-oob_22388d0_3435_cov_3297128910_small_roll5_FlashCine1.cine
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1d3a3b9f8907625b361420d48fe05716859620ff)

Conflicts:

libavcodec/rawdec.c

9 years agoavcodec/pngdec: Check IHDR/IDAT order
Michael Niedermayer [Wed, 26 Nov 2014 14:45:47 +0000 (15:45 +0100)]
avcodec/pngdec: Check IHDR/IDAT order

Fixes out of array access
Fixes: asan_heap-oob_20a6c26_2690_cov_3434532168_mail.png
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 79ceaf827be0b070675d4cd0a55c3386542defd8)

Conflicts:

libavcodec/pngdec.c

9 years agoavcodec/flacdec: Call ff_flacdsp_init() unconditionally
Michael Niedermayer [Wed, 26 Nov 2014 02:29:03 +0000 (03:29 +0100)]
avcodec/flacdec: Call ff_flacdsp_init() unconditionally

Fixes out of array access
Fixes: signal_sigsegv_324b135_3398_cov_246853371_short.flac
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e5c01ccdf5a9a330d4c51a9b9ea721fd8f1fb70b)

Conflicts:

libavcodec/flacdec.c

9 years agoavcodec/utils: Check that the data is complete in avpriv_bprint_to_extradata()
Michael Niedermayer [Tue, 25 Nov 2014 13:45:30 +0000 (14:45 +0100)]
avcodec/utils: Check that the data is complete in avpriv_bprint_to_extradata()

Fixes out of array read
Fixes: asan_heap-oob_4d2250_814_cov_2745172097_JACOsub_capability_tester.jss
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3d5d95db3f5d8e2093e9e19d0c46e86f54ed2a5d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/mjpegdec: Fix context fields becoming inconsistent
Michael Niedermayer [Tue, 25 Nov 2014 12:53:06 +0000 (13:53 +0100)]
avcodec/mjpegdec: Fix context fields becoming inconsistent

Fixes out of array access
Fixes: asan_heap-oob_1ca4f85_2760_cov_144449187_miss_congeniality_pegasus_ljpg.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0eecf40935b22644e6cd74c586057237ecfd6844)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoswscale/x86/rgb2rgb_template: handle the first 2 lines with C in rgb24toyv12_*()
Michael Niedermayer [Wed, 19 Nov 2014 23:43:45 +0000 (00:43 +0100)]
swscale/x86/rgb2rgb_template: handle the first 2 lines with C in rgb24toyv12_*()

This avoids out of array accesses
Should fix Ticket3451

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavformat/hlsenc: Free context after hls_append_segment
Michael Niedermayer [Sun, 16 Nov 2014 03:02:56 +0000 (04:02 +0100)]
avformat/hlsenc: Free context after hls_append_segment

Fixes reading uninitialized memory

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

Conflicts:

libavformat/hlsenc.c
(cherry picked from commit 0ac22f043bee2f1c4daf5e1044b014326325d929)

Conflicts:

libavformat/hlsenc.c
(cherry picked from commit 134d3e1c0331462ea94c78a5e13a63b20d283653)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/wmaprodec: Fix integer overflow in sfb_offsets initialization
Michael Niedermayer [Mon, 10 Nov 2014 22:07:50 +0000 (23:07 +0100)]
avcodec/wmaprodec: Fix integer overflow in sfb_offsets initialization

Fixes out of array read
Fixes: asan_heap-oob_2aec5b0_1828_classical_22_16_2_16000_v3c_0_exclusive_0_29.wma
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5dcb99033df16eccc4dbbc4a099ad64457f9f090)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/utvideodec: fix assumtation that slice_height >= 1
Michael Niedermayer [Mon, 10 Nov 2014 18:44:20 +0000 (19:44 +0100)]
avcodec/utvideodec: fix assumtation that slice_height >= 1

Fixes out of array read
Fixes: asan_heap-oob_2573085_3783_utvideo_rgba_median.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7656c4c6e66f8a787d384f027ad824cc1677fda1)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/options_table fix min of audio channels and sample rate
Michael Niedermayer [Mon, 3 Nov 2014 12:20:24 +0000 (13:20 +0100)]
avcodec/options_table fix min of audio channels and sample rate

Found-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 206c98f303e833c9e94427c9e3f9867f85265f78)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agolavc/utils: Make pix_fmt desc pointer const.
Carl Eugen Hoyos [Wed, 29 Oct 2014 23:27:04 +0000 (00:27 +0100)]
lavc/utils: Make pix_fmt desc pointer const.

Fixes an "initialization discards qualifiers from pointer target type" warning.
(cherry picked from commit f05855414ed4cce97c06ba2a31f4987af47e6d4e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/h264_slice: Clear table pointers to avoid stale pointers
Michael Niedermayer [Sun, 2 Nov 2014 00:55:40 +0000 (01:55 +0100)]
avcodec/h264_slice: Clear table pointers to avoid stale pointers

Might fix Ticket3889

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

Conflicts:

libavcodec/h264_slice.c

9 years agoavcodec/svq1dec: zero terminate embedded message before printing
Michael Niedermayer [Thu, 30 Oct 2014 17:16:25 +0000 (18:16 +0100)]
avcodec/svq1dec: zero terminate embedded message before printing

Fixes out of array access
Fixes: asan_stack-oob_49b1e5_10_009.mov
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e91ba2efa949470e9157b652535d207a101f91e0)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/cook: check that the subpacket sizes fit in block_align
Michael Niedermayer [Thu, 30 Oct 2014 15:53:09 +0000 (16:53 +0100)]
avcodec/cook: check that the subpacket sizes fit in block_align

Fixes out of array read
Fixes: asan_heap-oob_fb5c50_19_018.rmvb
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 10e32618acce9c3fc64c061eb7907e8a8d2749ae)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/g2meet: check tile dimensions to avoid integer overflow
Michael Niedermayer [Thu, 30 Oct 2014 00:19:17 +0000 (01:19 +0100)]
avcodec/g2meet: check tile dimensions to avoid integer overflow

Fixes out of array access
Fixes: asan_heap-oob_12a55d3_30_029.wmv
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 32e666c354e4a3160d8cf1d303cb51990b095c87)

Conflicts:

libavcodec/g2meet.c

9 years agoavcodec/utils: Align dimensions by at least their chroma sub-sampling factors.
Michael Niedermayer [Wed, 29 Oct 2014 13:15:29 +0000 (14:15 +0100)]
avcodec/utils: Align dimensions by at least their chroma sub-sampling factors.

Fixes: out of array accesses
Fixes: asan_heap-oob_112c6b3_13_012.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit df74811cd53e45fcbbd3b77a1c42416816687c5c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/dnxhddec: treat pix_fmt like width/height
Michael Niedermayer [Tue, 28 Oct 2014 23:57:07 +0000 (00:57 +0100)]
avcodec/dnxhddec: treat pix_fmt like width/height

Fixes out of array accesses
Fixes: asan_heap-oob_22c9a39_16_015.mxf
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f3c0e0bf6f53df0977f3878d4f5cec99dff8de9e)

Conflicts:

libavcodec/dnxhddec.c

9 years agoavcodec/dxa: check dimensions
Michael Niedermayer [Tue, 28 Oct 2014 14:26:42 +0000 (15:26 +0100)]
avcodec/dxa: check dimensions

Fixes out of array access
Fixes: asan_heap-oob_11222fb_21_020.dxa
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e70312dfc22c4e54d5716f28f28db8f99c74cc90)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/dirac_arith: fix integer overflow
Michael Niedermayer [Tue, 28 Oct 2014 01:14:41 +0000 (02:14 +0100)]
avcodec/dirac_arith: fix integer overflow

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/diracdec: Tighter checks on CODEBLOCKS_X/Y
Michael Niedermayer [Tue, 28 Oct 2014 00:23:40 +0000 (01:23 +0100)]
avcodec/diracdec: Tighter checks on CODEBLOCKS_X/Y

Fixes very long but finite loop
Fixes: asan_heap-oob_107866c_42_041.drc
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5145d22b88b9835db81c4d286b931a78e08ab76a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/diracdec: Use 64bit in calculation of codeblock coordinates
Michael Niedermayer [Tue, 28 Oct 2014 00:23:40 +0000 (01:23 +0100)]
avcodec/diracdec: Use 64bit in calculation of codeblock coordinates

Fixes integer overflow
Fixes out of array read
Fixes: asan_heap-oob_107866c_42_041.drc
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 526886e6069636a918c8c04db17e864e3d8151c1)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agopostproc: fix qp count
Michael Niedermayer [Mon, 13 Oct 2014 14:02:42 +0000 (16:02 +0200)]
postproc: fix qp count

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agopostproc/postprocess: fix quant store for fq mode
Michael Niedermayer [Sun, 12 Oct 2014 18:26:27 +0000 (20:26 +0200)]
postproc/postprocess: fix quant store for fq mode

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

Conflicts:

tests/ref/fate/filter-pp3
(cherry picked from commit 705748caf3f6a4a3e74ad3d2fc547a5a0213a521)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoutvideoenc: properly set slice height/last line
Christophe Gisquet [Thu, 9 Oct 2014 21:27:38 +0000 (23:27 +0200)]
utvideoenc: properly set slice height/last line

Mimic decoder and obey sampling.

Does not affect fate tests for utvideo.
Fixes ticket #3949.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoswresample/swresample: fix sample drop loop end condition
Michael Niedermayer [Sun, 5 Oct 2014 23:08:20 +0000 (01:08 +0200)]
swresample/swresample: fix sample drop loop end condition

Fixes Ticket3985

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/h264: Check mode before considering mixed mode intra prediction
Michael Niedermayer [Sat, 4 Oct 2014 12:51:46 +0000 (14:51 +0200)]
avcodec/h264: Check mode before considering mixed mode intra prediction

Fixes out of array read
Fixes: asan_heap-oob_e476fc_2_asan_heap-oob_1333ec6_61_CAMACI3_Sony_C.jsv

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavformat/mpegts: Check desc_len / get8() return code
Michael Niedermayer [Sat, 4 Oct 2014 02:29:40 +0000 (04:29 +0200)]
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>
9 years agoavcodec/vorbisdec: Fix off by 1 error in ptns_to_read
Michael Niedermayer [Sat, 4 Oct 2014 01:12:34 +0000 (03:12 +0200)]
avcodec/vorbisdec: Fix off by 1 error in ptns_to_read

Fixes read of uninitialized memory
Fixes: asan_heap-uaf_18dac2b_9_asan_heap-uaf_22eb375_208_beta3_test_small.ogg

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/smc: fix off by 1 error
Michael Niedermayer [Fri, 3 Oct 2014 20:50:45 +0000 (22:50 +0200)]
avcodec/smc: fix off by 1 error

Fixes out of array access
Fixes: asan_heap-oob_1685bf0_5_asan_heap-oob_1f35116_430_smc.mov

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/qpeg: fix off by 1 error in MV bounds check
Michael Niedermayer [Fri, 3 Oct 2014 19:08:52 +0000 (21:08 +0200)]
avcodec/qpeg: fix off by 1 error in MV bounds check

Fixes out of array access
Fixes: asan_heap-oob_153760f_4_asan_heap-oob_1d7a4cf_164_VWbig6.avi

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/gifdec: factorize interleave end handling out
Michael Niedermayer [Fri, 3 Oct 2014 18:15:52 +0000 (20:15 +0200)]
avcodec/gifdec: factorize interleave end handling out

also change it to a loop
Fixes out of array access
Fixes: asan_heap-oob_ca5410_8_asan_heap-oob_ca5410_97_ID_LSD_Size_Less_Then_Data_Inter_3.gif

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/cinepak: fix integer underflow
Michael Niedermayer [Fri, 3 Oct 2014 17:33:01 +0000 (19:33 +0200)]
avcodec/cinepak: fix integer underflow

Fixes out of array access
Fixes: asan_heap-oob_4da0ba_6_asan_heap-oob_4da0ba_241_cvid_crash.avi

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/pngdec: Calculate MPNG bytewidth more defensively
Michael Niedermayer [Fri, 3 Oct 2014 15:54:21 +0000 (17:54 +0200)]
avcodec/pngdec: Calculate MPNG bytewidth more defensively

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

Conflicts:

libavcodec/pngdec.c

9 years agoavcodec/pngdec: Check bits per pixel before setting monoblack pixel format
Michael Niedermayer [Fri, 3 Oct 2014 15:35:58 +0000 (17:35 +0200)]
avcodec/pngdec: Check bits per pixel before setting monoblack pixel format

Fixes out of array accesses
Fixes: asan_heap-oob_14dbfcf_4_asan_heap-oob_1ce5767_179_add_method_small.png

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/tiff: more completely check bpp/bppcount
Michael Niedermayer [Fri, 3 Oct 2014 14:08:32 +0000 (16:08 +0200)]
avcodec/tiff: more completely check bpp/bppcount

Fixes pixel format selection
Fixes out of array accesses
Fixes: asan_heap-oob_1766029_6_asan_heap-oob_20aa045_332_cov_1823216757_m2-d1d366d7965db766c19a66c7a2ccbb6b.tif

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/mmvideo: Bounds check 2nd line of HHV Intra blocks
Michael Niedermayer [Fri, 3 Oct 2014 12:45:04 +0000 (14:45 +0200)]
avcodec/mmvideo: Bounds check 2nd line of HHV Intra blocks

Fixes out of array access
Fixes: asan_heap-oob_4da4f3_8_asan_heap-oob_4da4f3_419_scene1a.mm

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/utils: Add case for jv to avcodec_align_dimensions2()
Michael Niedermayer [Fri, 3 Oct 2014 02:30:58 +0000 (04:30 +0200)]
avcodec/utils: Add case for jv to avcodec_align_dimensions2()

Fixes out of array accesses
Fixes: asan_heap-oob_12304aa_8_asan_heap-oob_4da4f3_300_intro.jv

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/mjpegdec: check bits per pixel for changes similar to dimensions
Michael Niedermayer [Thu, 2 Oct 2014 23:50:27 +0000 (01:50 +0200)]
avcodec/mjpegdec: check bits per pixel for changes similar to dimensions

Fixes out of array accesses
Fixes: asan_heap-oob_16668e9_2_asan_heap-oob_16668e9_346_miss_congeniality_pegasus_mjpg.avi

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

Conflicts:

libavcodec/mjpegdec.c

9 years agoavcodec/jpeglsdec: Check run value more completely in ls_decode_line()
Michael Niedermayer [Thu, 2 Oct 2014 21:17:21 +0000 (23:17 +0200)]
avcodec/jpeglsdec: Check run value more completely in ls_decode_line()

previously it could have been by 1 too large
Fixes out of array access
Fixes: asan_heap-oob_12240f5_1_asan_heap-oob_12240f5_448_t8c1e3.jls
Fixes: asan_heap-oob_12240f5_1_asan_heap-oob_12240f5_448_t8nde0.jls
Fixes: asan_heap-oob_12240fa_1_asan_heap-oob_12240fa_448_t16e3.jls

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoconfigure: add noexecstack to linker options if supported.
Reimar Döffinger [Sun, 21 Sep 2014 08:58:10 +0000 (09:58 +0100)]
configure: add noexecstack to linker options if supported.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
(cherry picked from commit b7082d953fda93f7841ffffe7d15a6c3cd15bdee)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/ac3enc_template: fix out of array read
Michael Niedermayer [Sat, 27 Sep 2014 18:34:44 +0000 (20:34 +0200)]
avcodec/ac3enc_template: fix out of array read

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavutil/x86/cpu: fix cpuid sub-leaf selection
lvqcl [Sat, 27 Sep 2014 11:21:31 +0000 (13:21 +0200)]
avutil/x86/cpu: fix cpuid sub-leaf selection

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agolibavutil/opt: fix av_opt_set_channel_layout() to access correct memory address
Philip DeCamp [Wed, 24 Sep 2014 20:15:18 +0000 (16:15 -0400)]
libavutil/opt: fix av_opt_set_channel_layout() to access correct memory address

Signed-off-by: Philip DeCamp <decamp@mit.edu>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 857fc0a71f1b52fbba3281ba64b5a35195458622)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavformat/riffenc: Filter out "BottomUp" in ff_put_bmp_header()
Benoit Fouet [Tue, 23 Sep 2014 08:07:10 +0000 (10:07 +0200)]
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>
9 years agoavcodec/webp: fix default palette color 0xff000000 -> 0x00000000
Pascal Massimino [Mon, 22 Sep 2014 21:48:57 +0000 (14:48 -0700)]
avcodec/webp: fix default palette color 0xff000000 -> 0x00000000

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/libilbc: support for latest git of libilbc
Gianluigi Tiesi [Fri, 19 Sep 2014 02:49:36 +0000 (04:49 +0200)]
avcodec/libilbc: support for latest git of libilbc

in the latest git commits of libilbc developers removed WebRtc_xxx typedefs

This commit uses int types instead,
it's safe to apply also for previous versions since
WebRtc_Word16 was always a typedef of int16_t and
WebRtc_UWord16 a typedef of uint16_t

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agox86/dsputil: add emms to ff_scalarproduct_int16_mmxext()
James Almer [Wed, 5 Mar 2014 22:44:36 +0000 (19:44 -0300)]
x86/dsputil: add emms to ff_scalarproduct_int16_mmxext()

Also undo the changes to ra144enc.c from previous commits.
Should fix ticket #3429

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 9e0e1f9067430de1655a7b28536b5afed48bded5)

Conflicts:

libavcodec/ra144enc.c

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agolibavcodec/webp: treat out-of-bound palette index as translucent black
Pascal Massimino [Tue, 16 Sep 2014 15:01:07 +0000 (17:01 +0200)]
libavcodec/webp: treat out-of-bound palette index as translucent black

See https://code.google.com/p/webp/issues/detail?id=206
for a description of the problem/fix.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This patch makes the decoder follow the recommendation of the spec.
There is some disagreement (see "[FFmpeg-devel] [PATCH]: libavcodec/webp")
about what would be best to be written in the spec, so in case the spec
is changed again, this potentially would need to be amended or reverted
(cherry picked from commit 4fd21d58a72c38ab63c3a4483b420db260fa7b8d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoapetag: Fix APE tag size check
Katerina Barone-Adesi [Mon, 15 Sep 2014 23:40:24 +0000 (01:40 +0200)]
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.

CC: libav-stable@libav.org
Signed-off-by: Diego Biurrun <diego@biurrun.de>
(cherry picked from commit c5560e72d0bb69f8a1ac9536570398f84388f396)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agotools/crypto_bench: fix build when AV_READ_TIME is unavailable
Michael Niedermayer [Tue, 16 Sep 2014 16:04:51 +0000 (18:04 +0200)]
tools/crypto_bench: fix build when AV_READ_TIME is unavailable

Found-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4a99134f1a71994a0dc4542a0d6bee8e36146b60)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavformat/m4vdec: Check for non startcode 00 00 00 sequences in probe
Michael Niedermayer [Sun, 7 Sep 2014 14:39:39 +0000 (16:39 +0200)]
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>
9 years agoavcodec/mpegvideo: Set err on failure in ff_mpv_common_frame_size_change()
Michael Niedermayer [Sun, 7 Sep 2014 12:14:52 +0000 (14:14 +0200)]
avcodec/mpegvideo: Set err on failure in ff_mpv_common_frame_size_change()

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/mpegvideo: check that the context is initialized in ff_mpv_common_frame_size_...
Michael Niedermayer [Sun, 7 Sep 2014 11:00:47 +0000 (13:00 +0200)]
avcodec/mpegvideo: check that the context is initialized in ff_mpv_common_frame_size_change()

The function otherwise would initialize the context without setting context_initialized
alternatively we could set context_initialized

Fixes valgrind anomalies related to ticket 3928

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/mpegvideo: Use "goto fail" for all error paths in ff_mpv_common_frame_size_ch...
Michael Niedermayer [Sun, 7 Sep 2014 10:52:24 +0000 (12:52 +0200)]
avcodec/mpegvideo: Use "goto fail" for all error paths in ff_mpv_common_frame_size_change()

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/h264: Allow partial escaping
Michael Niedermayer [Sat, 6 Sep 2014 23:42:28 +0000 (01:42 +0200)]
avcodec/h264: Allow partial escaping

Fixes Ticket3923

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavformat/swfdec: Do not change the pixel format
Michael Niedermayer [Tue, 2 Sep 2014 14:42:33 +0000 (16:42 +0200)]
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>
9 years agoavformat/swfdec: Use side data to communicate w/h changes to the decoder
Michael Niedermayer [Tue, 2 Sep 2014 03:22:26 +0000 (05:22 +0200)]
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>
9 years agosegment: don't access outside seg->frames array
Mika Raento [Mon, 1 Sep 2014 17:10:03 +0000 (20:10 +0300)]
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>
9 years agooggdec: fix invalid free on error
wm4 [Sat, 30 Aug 2014 13:39:15 +0000 (15:39 +0200)]
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
(cherry picked from commit a82401b7284e05e2cf6fb89aeed53738af06a7fd)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/snow: check coeffs for validity
Michael Niedermayer [Sat, 30 Aug 2014 00:12:10 +0000 (02:12 +0200)]
avcodec/snow: check coeffs for validity

Fixes deadlock
Fixes integer overflow
Fixes Ticket 3892

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agobktr: Fix Fabrice's name
Timothy Gu [Tue, 26 Aug 2014 23:13:52 +0000 (16:13 -0700)]
bktr: Fix Fabrice's name

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
This file with the incorrect name was added after the name was fixed in all other files.
This is thus fixing a mistake

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/utils: add GBRP16 to avcodec_align_dimensions2()
Michael Niedermayer [Sun, 24 Aug 2014 21:33:40 +0000 (23:33 +0200)]
avcodec/utils: add GBRP16 to avcodec_align_dimensions2()

Fixes Ticket3869

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec: fix aac/ac3 parser bitstream buffer size
Michael Niedermayer [Thu, 21 Aug 2014 23:15:57 +0000 (01:15 +0200)]
avcodec: fix aac/ac3 parser bitstream buffer size

Buffers containing copies of the AAC and AC3 header bits were not padded
before parsing, violating init_get_bits() buffer padding requirement,
leading to potential buffer read overflows.
This change adds FF_INPUT_BUFFER_PADDING_SIZE bytes to the bit buffer
for parsing the header in each of aac_parser.c and ac3_parser.c.

Based on patch by: Matt Wolenetz <wolenetz@chromium.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit fccd85b9f30525f88692f53134eba41f1f2d90db)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agowavpackenc: proper buffer allocation
Christophe Gisquet [Tue, 19 Aug 2014 12:26:49 +0000 (12:26 +0000)]
wavpackenc: proper buffer allocation

The allocation didn't account for headers, that can be easily 79 bytes.
As a result, buffers allocated for a few samples (e.g. 5 in the original
bug) could be undersized.

Fixed ticket #2881.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agowavpack: report if there is no bits left
Christophe Gisquet [Tue, 19 Aug 2014 12:26:47 +0000 (12:26 +0000)]
wavpack: report if there is no bits left

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoproresenc_kostya: properly account for alpha
Christophe Gisquet [Mon, 11 Aug 2014 17:43:27 +0000 (19:43 +0200)]
proresenc_kostya: properly account for alpha

The packet buffer allocation considered as dct-coded, while it is
actually run-coded and thus requires a larger buffer.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoproresenc_kostya: report buffer overflow
Christophe Gisquet [Mon, 11 Aug 2014 22:06:08 +0000 (22:06 +0000)]
proresenc_kostya: report buffer overflow

If the allocated size, despite best efforts, is too small, exit
with the appropriate error.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoproresenc_kostya: remove unneeded parameters
Christophe Gisquet [Mon, 11 Aug 2014 22:06:07 +0000 (22:06 +0000)]
proresenc_kostya: remove unneeded parameters

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/snow: fix null pointer dereference in cleanup after allocation failure
Michael Niedermayer [Mon, 11 Aug 2014 13:36:22 +0000 (15:36 +0200)]
avcodec/snow: fix null pointer dereference in cleanup after allocation failure

Fixes: snowf.avi
Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 9a162146ca6cc12ef7ad4a15164349482885962c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/iff: check pixfmt for rgb8 / rgbn
Michael Niedermayer [Sun, 10 Aug 2014 19:59:33 +0000 (21:59 +0200)]
avcodec/iff: check pixfmt for rgb8 / rgbn

Fixes out of array access

Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3539d6c63a16e1b2874bb037a86f317449c58770)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agocdgraphics: do not return 0 from the decode function
Anton Khirnov [Wed, 6 Aug 2014 10:56:34 +0000 (10:56 +0000)]
cdgraphics: do not return 0 from the decode function

0 means no data consumed, so it can trigger an infinite loop in the
caller.

CC:libav-stable@libav.org
(cherry picked from commit c7d9b473e28238d4a4ef1b7e8b42c1cca256da36)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoffserver: initialize pbuffer in prepare_sdp_description()
Michael Niedermayer [Sat, 2 Aug 2014 12:03:30 +0000 (14:03 +0200)]
ffserver: initialize pbuffer in prepare_sdp_description()

also check pbuffer before use

Found-by: CSA
Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1d8d21b90ab91aa471f369e0f9d1ea20fb40733b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/wavpackenc: Fix log2sample() result value
Michael Niedermayer [Sat, 2 Aug 2014 16:15:12 +0000 (18:15 +0200)]
avcodec/wavpackenc: Fix log2sample() result value

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavformat/tee: flip assigment direction
Michael Niedermayer [Sat, 2 Aug 2014 20:30:03 +0000 (22:30 +0200)]
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>
9 years agoffmpeg_opt: Use av_guess_codec() instead of AVOutputFormat->*codec
Michael Niedermayer [Sat, 2 Aug 2014 01:29:42 +0000 (03:29 +0200)]
ffmpeg_opt: Use av_guess_codec() instead of AVOutputFormat->*codec

Fixes part of ticket2236

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/dvdsub_parser: print message if packet is smaller than the packet size field
Michael Niedermayer [Fri, 1 Aug 2014 23:16:14 +0000 (01:16 +0200)]
avcodec/dvdsub_parser: print message if packet is smaller than the packet size field

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/dvdsub_parser: Check buf_size before reading 32bit packet size
Michael Niedermayer [Fri, 1 Aug 2014 23:15:37 +0000 (01:15 +0200)]
avcodec/dvdsub_parser: Check buf_size before reading 32bit packet size

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/dvdsub_parser: never return 0 when the input isnt 0
Michael Niedermayer [Fri, 1 Aug 2014 22:27:23 +0000 (00:27 +0200)]
avcodec/dvdsub_parser: never return 0 when the input isnt 0

Fixes a infinite loop
Fixes Ticket3804

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agov4l2enc: adding AVClass
Anshul Maheswhwari [Thu, 31 Jul 2014 15:29:59 +0000 (20:59 +0530)]
v4l2enc: adding AVClass

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavformat/avidec: fix handling dv in avi
Michael Niedermayer [Fri, 21 Nov 2014 02:08:20 +0000 (03:08 +0100)]
avformat/avidec: fix handling dv in avi

Fixes Ticket4086

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

9 years agoavformat/oggparseopus: Check opus_duration() return value
James Almer [Thu, 12 Dec 2013 06:34:19 +0000 (03:34 -0300)]
avformat/oggparseopus: Check opus_duration() return value

Regression since 39d11d599cd292485fe991cd22e10d7a1738b3bc

os->pduration would be wrongly assigned a negative value on invalid packets
instead of aborting.

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c619e14c314b44d86a8d552259afb957c0b6775d)

9 years agoavformat/oggparseopus: calculate pts/dts for initial packets after seeking
Michael Niedermayer [Thu, 11 Sep 2014 21:50:35 +0000 (23:50 +0200)]
avformat/oggparseopus: calculate pts/dts for initial packets after seeking

based on code from oggparsevorbis
Fixes Ticket3124
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7f39352a1b661771cf471986059027acd8e0e31f)

Fixes ticket #3943.

9 years agoavformat/oggparseopus: factor opus_duration() out
Michael Niedermayer [Wed, 11 Dec 2013 03:15:38 +0000 (04:15 +0100)]
avformat/oggparseopus: factor opus_duration() out

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

9 years agolibavutil: fix av_err2str compiling error for C++ android-x86-4.4-r1
Chih-Wei Huang [Sun, 3 Nov 2013 16:06:07 +0000 (00:06 +0800)]
libavutil: fix av_err2str compiling error for C++

The implementation may not be thread-safe. But good enough for us.

9 years agoAndroid porting for ffmpeg 2.1 release
Chih-Wei Huang [Sat, 2 Nov 2013 16:08:04 +0000 (00:08 +0800)]
Android porting for ffmpeg 2.1 release

Add Android.mk to build ffmpeg libraries with AOSP tree.
Based on the nice work of Chia-I Wu (olv):
git://gitorious.org/~olvaffe/ffmpeg/ffmpeg-android

Tested built OK on Android 4.3 for x86, mips, armv7-a and armv7-a-neon.

9 years agovc1: Do not return an error when skipping b frames
Alessandro Ghedini [Mon, 21 Apr 2014 17:10:52 +0000 (19:10 +0200)]
vc1: Do not return an error when skipping b frames

This caused mpv (and possibly others) to fallback to software decoding after
seeking a VC1 stream.

Bug-Id: 667

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit cdf6eb5a9710566be217a3f17d3d94ac4e4d2662)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavformat/dv: implement fallback in dv_extract_pack()
Michael Niedermayer [Thu, 17 Jul 2014 02:25:21 +0000 (04:25 +0200)]
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>
9 years agoavcodec/hevc: treat current_sps like sps_list
Michael Niedermayer [Tue, 15 Jul 2014 19:43:30 +0000 (21:43 +0200)]
avcodec/hevc: treat current_sps like sps_list

This simplifies the management of current_sps
Fixes Ticket3458

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

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/hevc_ps: prevent stale pointer in malloc failure case
Michael Niedermayer [Tue, 15 Jul 2014 19:43:04 +0000 (21:43 +0200)]
avcodec/hevc_ps: prevent stale pointer in malloc failure case

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

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/hevc_ps: do not loose all reference to pointers still in use
Michael Niedermayer [Sat, 12 Jul 2014 04:36:25 +0000 (06:36 +0200)]
avcodec/hevc_ps: do not loose all reference to pointers still in use

Fixes leaving a pointer to unreferenced memory
Fixes Ticket 3115

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

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

Conflicts:

libavcodec/hevc.c

9 years agoffmpeg: Use av_stream_get_parser() to avoid ABI issues
Michael Niedermayer [Mon, 14 Jul 2014 19:06:58 +0000 (21:06 +0200)]
ffmpeg: Use av_stream_get_parser() to avoid ABI issues

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

Conflicts:

ffmpeg.c
(cherry picked from commit 8fae6207e30059611cdc788ad440b6831637f86f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavformat: add av_stream_get_parser() to access avformat AVParser
Michael Niedermayer [Mon, 14 Jul 2014 19:03:43 +0000 (21:03 +0200)]
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
(cherry picked from commit a78e6363e9a7ef90bd1ff4aeceee8e5501cbc6d4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavformat/utils: do not wait for packets from discarded streams for genpts
Michael Niedermayer [Sat, 12 Jul 2014 23:07:59 +0000 (01:07 +0200)]
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>
9 years agoavcodec/hevc: Use av_malloc(z)_array()
Michael Niedermayer [Tue, 1 Jul 2014 01:50:17 +0000 (03:50 +0200)]
avcodec/hevc: Use av_malloc(z)_array()

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

Conflicts:

libavcodec/hevc.c

9 years agoavfilter/x86/vf_pullup: fix old typo
Michael Niedermayer [Wed, 25 Jun 2014 16:10:12 +0000 (18:10 +0200)]
avfilter/x86/vf_pullup: fix old typo

This makes C and MMX match, no change to fate as the differences where
apparently not sufficient to show up in fate

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavfilter/vf_pullup: use ptrdiff_t as stride argument for dsp functions
Michael Niedermayer [Wed, 25 Jun 2014 15:49:03 +0000 (17:49 +0200)]
avfilter/vf_pullup: use ptrdiff_t as stride argument for dsp functions

This should avoid issues on x86_64

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>