Compare commits

...

1229 Commits

Author SHA1 Message Date
Michael Niedermayer
7608871734 MAINTAINERS: Remove myself as leader
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit f2c58931e629343f7d68258cc2b2d62c5f501ba5)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-31 18:35:35 +02:00
Michael Niedermayer
73bfb21672 Update for 1.1.16
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 18:09:08 +01:00
Michael Niedermayer
86dac9d6b1 avcodec/012v: redesign main loop
Fixes out of array accesses
Fixes: ffmpeg_012v_crash.ts

Found-by: Thomas Lindroth <thomas.lindroth@gmail.com>
Reviewed-by: Thomas Lindroth <thomas.lindroth@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 48df30d36c3ca360c407d84f96749888d1fbe853)

Conflicts:

	libavcodec/012v.c
2015-03-13 17:06:10 +01:00
Andreas Cadhalpun
645a299132 ffmdec: make sure the time base is valid
A negative time base can trigger assertions.

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

Conflicts:

	libavformat/ffmdec.c
(cherry picked from commit 9678ceb6976ca8194848b24535785a298521211f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 17:06:10 +01:00
Dyami Caliri
b8c5cd5b8d Fix buffer_size argument to init_put_bits() in multiple encoders.
Several encoders were multiplying the buffer size by 8, in order to get
a bit size. However, the buffer_size argument is for the byte size of
the buffer. We had experienced crashes encoding prores (Anatoliy) at
size 4096x4096.
(cherry picked from commit 50833c9f7b4e1922197a8955669f8ab3589c8cef)

Conflicts:

	libavcodec/proresenc_kostya.c

Conflicts:

	libavcodec/faxcompr.c
	libavcodec/s302menc.c
2015-03-13 17:06:10 +01:00
Andreas Cadhalpun
e256506950 roqvideoenc: set enc->avctx in roq_encode_init
So far it is only set in roq_encode_frame, but it is used in
roq_encode_end to free the coded_frame. This currently segfaults if
roq_encode_frame is not called between roq_encode_init and
roq_encode_end.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 17:06:10 +01:00
Michael Niedermayer
3cb8490066 avcodec/options_table: remove extradata_size from the AVOptions table
allowing access to the size but not the extradata itself is not useful
and could lead to potential problems if writing happens through this field

Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Reviewed-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1f4088b28540080ce1d42345c5614be3e1a6a197)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 17:06:10 +01:00
Andreas Cadhalpun
8d0112d8fc ffmdec: limit the backward seek to the last resync position
If resyncing leads to the same position as previously, it will again
lead to a resync attempt, resulting in an infinite loop.

Thus don't seek back beyond the last syncpoint.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6b8263b03ab3d16d70525ae1893cb106be7852f1)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 17:06:10 +01:00
Andreas Cadhalpun
fdb05ff57b ffmdec: fix infinite loop at EOF
If EOF is reached, while skipping bytes, avio_tell(pb) won't change
anymore, resulting in an infinite loop.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6fa98822eba501a4898fdec5b75acd3026201005)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 17:06:09 +01:00
Michael Niedermayer
676dff8c54 avcodec/tiff: move bpp check to after "end:"
This ensures that all current and future code-pathes get bpp checked

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

Conflicts:

	libavcodec/tiff.c
2015-03-13 17:06:09 +01:00
Michael Niedermayer
95d6bd95b1 avcodec/utils: Align YUV411 by as much as the other YUV variants
Fixes out of array accesses
Fixes: ffmpeg_mjpeg_crash2.avi

Found-by: Thomas Lindroth <thomas.lindroth@gmail.com>
Tested-by: Thomas Lindroth <thomas.lindroth@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e3201c38d53d2b8b24d0bc95d726b2cb1752dc12)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 17:06:09 +01:00
Andreas Cadhalpun
c80c0b2637 avformat/flvenc: check that the codec_tag fits in the available bits
flags is later written with avio_w8 and if it doesn't fit in one byte it
triggers an av_assert2.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 17:06:09 +01:00
Michael Niedermayer
190e8b4283 swscale/utils: clear formatConvBuffer on allocation
Fixes use of uninitialized memory
Fixes: asan_heap-oob_35ca682_1474_cov_3230122439_aletrek_tga_16bit.mov

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 17:06:09 +01:00
Andreas Cadhalpun
327b284b58 avformat/bit: only accept the g729 codec and 1 channel
Other codecs/channel numbers are not supported by this muxer.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 17:06:09 +01:00
Andreas Cadhalpun
c34ec56ea8 avformat/bit: check that pkt->size is 10 in write_packet
Ohter packet sizes are not supported by this muxer.

This avoids a null pointer dereference of pkt->data.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 17:06:09 +01:00
Andreas Cadhalpun
2f4c2cc6d3 avformat/adxdec: check avctx->channels for invalid values
This avoids a null pointer dereference of pkt->data.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7faa40af982960608b117e20fec999b48011e5e0)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 17:06:09 +01:00
James Cowgill
9814419deb mips/acelp_filters: fix incorrect register constraint
Change register constraint on the v variable from = to +. This was causing GCC
to think that the v variable was never read and therefore not initialize it.

This fixes about 20 fate failures on mips64el.

Signed-off-by: James Cowgill <james410@cowgill.org.uk>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b9de1303a6414174ab2f3bccefa801bfabcf0f88)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 17:06:09 +01:00
Michael Niedermayer
facd212f4a avcodec/zmbv: Check len before reading in decode_frame()
Fixes out of array read
Fixes: asan_heap-oob_4d4eb0_3994_cov_3169972261_zmbv_15bit.avi

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 17:06:09 +01:00
Michael Niedermayer
ec02afcb6e avcodec/snowdec: Fix ref value check
Fixes integer overflow and out of array read.
Fixes: signal_sigsegv_24169e6_3445_cov_3778346427_snow_chroma_bug.avi

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 17:06:09 +01:00
Michael Niedermayer
81f80d7b48 swscale/utils: More carefully merge and clear coefficients outside the input
Fixes out of array read
Fixes: asan_heap-oob_35ca682_1474_cov_3230122439_aletrek_tga_16bit.mov

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 17:06:09 +01:00
Andreas Cadhalpun
cbda382526 avcodec/a64multienc: fix use of uninitialized values in to_meta_with_crop
Averaging over 2 pixels doesn't work correctly for the last pixel, because the
rest of the buffer is not initialized.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 17:06:09 +01:00
Michael Niedermayer
03be529f39 avcodec/x86/mlpdsp_init: Simplify mlp_filter_channel_x86()
Based on patch by Francisco Blas Izquierdo Riera
Commit message partly taken from carl

fixes a compilation
error in mlpdsp_init.c with -fstack-check and some gcc compilers (I
reproduced the issue with gcc 4.7.3) by simplifying the code.

See also https://bugs.gentoo.org/show_bug.cgi?id=471756

$ make libavcodec/x86/mlpdsp_init.o
libavcodec/x86/mlpdsp_init.c: In function ‘mlp_filter_channel_x86’:
libavcodec/x86/mlpdsp_init.c:142:5: error: can’t find a register in
class ‘GENERAL_REGS’ while reloading ‘asm’
libavcodec/x86/mlpdsp_init.c:142:5: error: ‘asm’ operand has impossible
constraints

4551 -> 4509 dezicycles

Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 03f39fbb2a558153a3c464edec1378d637a755fe)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 17:06:09 +01:00
Michael Niedermayer
07dcf5b05a avformat/vqf: Use 64bit for ret to avoid overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cb08687180683a755d0fe9d425280d0e4d1e6db2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 17:06:09 +01:00
Michael Niedermayer
aef0c97b45 avformat/mvdec: Use 64bit for ret to avoid overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 26c0cc154e06cb0064b3a3da49447ac44d82444f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 17:06:09 +01:00
Michael Niedermayer
aa3b63a6a5 avformat/gxf: Use 64bit for res to avoid overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 12987f89007ee82b9d3a6090085dfaef8461ab8b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 17:06:09 +01:00
Michael Niedermayer
9db3ed2583 avcodec/mjpegdec: Skip blocks which are outside the visible area
Fixes out of array accesses
Fixes: ffmpeg_mjpeg_crash.avi

Found-by: Thomas Lindroth <thomas.lindroth@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 08509c8f86626815a3e9e68d600d1aacbb8df4bf)

Conflicts:

	libavcodec/mjpegdec.c
2015-03-13 17:06:09 +01:00
Michael Niedermayer
9d49f4e081 avcodec/h264_ps: More completely check the bit depths
Fixes out of array read
Fixes: asan_static-oob_30328b6_719_cov_3325483287_H264_artifacts_motion.h264

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

Conflicts:

	libavcodec/h264_ps.c

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 17:06:09 +01:00
Michael Niedermayer
7add0b0692 avformat/thp: Check av_get_packet() for failure not only for partial output
Fixes null pointer dereference
Fixes: signal_sigsegv_db2c1f_3108_cov_163322880_pikmin2_opening1_partial.thp

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 17:06:09 +01:00
Michael Niedermayer
097417299a swscale/utils: Limit filter shifting so as not to read from prior the array
Fixes out of array read
Fixes: asan_heap-oob_1fb2f9b_3780_cov_3984375136_usf.mkv

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 17:06:09 +01:00
Michael Niedermayer
3a691185f7 avcodec/mjpegdec: Check number of components for JPEG-LS
Fixes out of array accesses
Fixes: asan_heap-oob_1c1a4ea_1242_cov_2274415971_TESTcmyk.jpg

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

Conflicts:

	libavcodec/mjpegdec.c
2015-03-13 17:06:09 +01:00
Michael Niedermayer
6b4fc845f5 avcodec/mjpegdec: Check escape sequence validity
Fixes assertion failure
Fixes: asan_heap-oob_1c1a4ea_1242_cov_2274415971_TESTcmyk.jpg

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 17:06:09 +01:00
Michael Niedermayer
485f78be20 avformat/mpc8: Use uint64_t in *_get_v() to avoid undefined behavior
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 05e161952954acf247e0fd1fdef00559675c4d4d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 17:06:09 +01:00
wm4
21ebfcdd43 avformat/mpc8: fix broken pointer math
This could overflow and crash at least on 32 bit systems.

Reviewed-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b737a2c52857b214be246ff615c6293730033cfa)

Conflicts:

	libavformat/mpc8.c
(cherry picked from commit 49dd89f9027f3def12e170bb7d986d37812eedba)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 17:06:09 +01:00
wm4
5601f216bf avformat/mpc8: fix hang with fuzzed file
This can lead to an endless loop by seeking back a few bytes after each
attempted chunk read. Assuming negative sizes are always invalid, this
is easy to fix. Other code in this demuxer treats negative sizes as
invalid as well.

Fixes ticket #4262.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 17:06:09 +01:00
wm4
0a3371f382 avformat/tta: fix crash with corrupted files
av_add_index_entry() can fail, for example because the parameters are
invalid, or because memory allocation fails. Check this; it can actually
happen with corrupted files.

The second hunk is just for robustness. Just in case functions like
ff_reduce_index() remove entries. (Not sure if this can actually
happen.)

Fixes ticket #4294.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 17:06:09 +01:00
Michael Niedermayer
a1fec9d141 avcodec/mpegvideo_enc: Fix number suffixes in rc_buffer_size calculation
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4531e2c489d279bfc90d54ca26ed898c5b265a7f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 17:06:09 +01:00
Michael Niedermayer
2894f27761 avformat/smacker: Fix number suffix
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 465f3705b1ef832fd6904750d018f81f9044f3ab)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 17:06:09 +01:00
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
de84d683b2 avcodec/flac_parser: fix handling EOF if no headers are found
Fixes assertion failure
Fixes Ticket4269

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 17:06:09 +01:00
Michael Niedermayer
e9179e6673 ffmpeg: Clear error message array at init.
This avoids printing uninitialized bytes if no error message is set

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 17:06:08 +01:00
wm4
633461d8bb avcodec/dvdsubdec: error on bitmaps with size 0
Attemtping to decode them could lead to invalid writes with some fuzzed
samples.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 17:06:08 +01:00
Johan Andersson
77c20198bb cmdutils: update copyright year to 2015.
(cherry picked from commit 3e160652219ff4da433f5672ae1e5f4956abb815)

Conflicts:

	cmdutils.c
2015-03-13 17:06:08 +01:00
Michael Niedermayer
ad0c39c1f1 avformat/mov: Fix mixed declaration and statement warning
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit db27f50e0658e91758e8a17fdcf390e6bc93c1d2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 17:06:08 +01:00
Dale Curtis
3eee7e0db6 mov: Fix negative size calculation in mov_read_default().
The previous code assumed if an atom was marked with a 64-bit
size extension, it actually had that data available. The new
code verfies there's enough data in the atom for this to be
done.

Failure to verify causes total_size > atom.size which will
result in negative size calculations later on.

Found-by: Paul Mehta <paul@paulmehta.com>
Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3ebd76a9c57558e284e94da367dd23b435e6a6d0)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 17:06:08 +01:00
Michael Niedermayer
e2e66f2f99 avformat/mov: fix integer overflow in mov_read_udta_string()
Found-by: Paul Mehta <paul@paulmehta.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3859868c75313e318ebc5d0d33baada62d45dd75)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 17:06:08 +01:00
Dale Curtis
b41bc71143 mov: Avoid overflow with mov_metadata_raw()
The code previously added 1 to len without checking its size,
resulting in an overflow which can corrupt value[-1] -- which
may be used to store unaligned ptr information for certain
allocators.

Found-by: Paul Mehta <paul@paulmehta.com>
Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 17:06:08 +01:00
wm4
1b9a62c357 avcodec/dvdsubdec: fix out of bounds accesses
The code blindly trusted buffer offsets read from the file in the RLE
decoder. Explicitly check the offset. Also error out on other RLE
decoding errors.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 17:06:08 +01:00
Michael Niedermayer
93c9f1b97c avformat/cdxl: Fix integer overflow of image_size
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3eb5cbe0c50d0a0bbe10bcabbd6b16d73d93c128)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 17:06:08 +01:00
Stefano Sabatini
e76a5a9c28 lavf/segment: remove duplicated and inconsistent cleanup code in seg_write_packet()
In particular, avoid to leave around the seg->avf pointer to freed
structure, and fix crash with:
ffmpeg -f lavfi -i testsrc -c:v h264 -map 0 -f segment foo-%d.ts
(cherry picked from commit 169065fbfb3da1ab776379c333aebc54bb1f1bc4)

Found-by: Qinghao Tang
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 17:06:08 +01:00
Michael Niedermayer
9f650fb5fb avcodec/012v: Check dimensions more completely
Fixes division by 0

Found-by: Thomas Lindroth <thomas.lindroth@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d3b25383daffac154846daeb4e4fb46569e728db)

Conflicts:

	libavcodec/012v.c
2015-03-10 20:30:25 +01:00
Michael Niedermayer
9e835572f8 Merge commit '798b3ed3fbc31672e6400e18db37deef03fff44f' into release/1.1
* commit '798b3ed3fbc31672e6400e18db37deef03fff44f':
  doc: More changelog updates for v9.18

Conflicts:
	Changelog

not merged

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-10 14:13:56 +01:00
Michael Niedermayer
d7a8d07fd8 Merge commit '62b0462e5fa78901380ca229ddb6a7625efd61a2' into release/1.1
* commit '62b0462e5fa78901380ca229ddb6a7625efd61a2':
  tiff: Check that there is no aliasing in pixel format selection

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-10 14:13:35 +01:00
Michael Niedermayer
a2dc8dcb66 Merge commit '789f433bc6376e6e45d41ae491007d482fa1df85' into release/1.1
* commit '789f433bc6376e6e45d41ae491007d482fa1df85':
  utvideodec: Handle slice_height being zero

No change, this has been fixed privously
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-10 14:13:05 +01:00
Michael Niedermayer
1beea3b859 Merge commit '3756b306a259d1376ce90404771c4d0ea7e23162' into release/1.1
* commit '3756b306a259d1376ce90404771c4d0ea7e23162':
  rmenc: limit packet size

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-10 13:48:44 +01:00
Michael Niedermayer
0baea332cb Merge commit 'ded9931d165544c342795a1b66e4777b6e7daeb0' into release/1.1
* commit 'ded9931d165544c342795a1b66e4777b6e7daeb0':
  rv10: check size of s->mb_width * s->mb_height

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-10 13:47:49 +01:00
Michael Niedermayer
396b47d2a7 Merge commit 'c17da32ba26d2c333bd9cd4afe38a1b36e3d6cba' into release/1.1
* commit 'c17da32ba26d2c333bd9cd4afe38a1b36e3d6cba':
  eamad: check for out of bounds read

Conflicts:
	libavcodec/eamad.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-10 13:45:40 +01:00
Michael Niedermayer
dec5586bc7 Merge commit '9841654c158c80e9d525ba03754135d3f34e306e' into release/1.1
* commit '9841654c158c80e9d525ba03754135d3f34e306e':
  arm: Suppress tags about used cpu arch and extensions

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-10 13:44:40 +01:00
Michael Niedermayer
c5587516ca Merge commit '42eaec076bbe2629c466695f71e7aa283a6fda51' into release/1.1
* commit '42eaec076bbe2629c466695f71e7aa283a6fda51':
  Prepare for 9.18 Release

Conflicts:
	RELEASE

not merged

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-10 13:38:18 +01:00
Michael Niedermayer
94bd579319 Merge commit '473281193bed8dcb3f6954a18d03cf6298d651b3' into release/1.1
* commit '473281193bed8dcb3f6954a18d03cf6298d651b3':
  Update Changelog for v9.18

Conflicts:
	Changelog

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-10 13:37:42 +01:00
Michael Niedermayer
eb6d64edef Merge commit '11f98c83d1c2a4eecd213bd94a907831fb36a590' into release/1.1
* commit '11f98c83d1c2a4eecd213bd94a907831fb36a590':
  img2dec: correctly use the parsed value from -start_number

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-10 13:37:20 +01:00
Michael Niedermayer
b69c7f20e8 Merge commit 'eb1aa871d4ef9fc11484de436fa02c352b1b7cac' into release/1.1
* commit 'eb1aa871d4ef9fc11484de436fa02c352b1b7cac':
  h264_cabac: Break infinite loops

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-10 13:11:53 +01:00
Michael Niedermayer
31b697f19c Merge commit '6222ee068eeb3d29a2bcc4a89ce31effdef5a061' into release/1.1
* commit '6222ee068eeb3d29a2bcc4a89ce31effdef5a061':
  matroskadec: Fix read-after-free in matroska_read_seek()

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-10 13:11:26 +01:00
Reinhard Tartler
798b3ed3fb doc: More changelog updates for v9.18 2015-03-08 22:22:28 -04:00
Anton Khirnov
62b0462e5f tiff: Check that there is no aliasing in pixel format selection
Fixes possible issues with unexpected bpp/bppcount values.

CC: libav-stable@libav.org
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Bug-Id: CVE-2014-8544
(cherry picked from commit ae5e1f3d663a8c9a532d89e588cbc61f171c9186)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit eb9041403d820634c45ed4ee98570246a252507a)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2015-03-08 22:11:54 -04:00
Michael Niedermayer
789f433bc6 utvideodec: Handle slice_height being zero
Fixes out of array accesses.

CC: libav-stable@libav.org
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Bug-Id: CVE-2014-9604
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 0ce3a0f9d9523a9bcad4c6d451ca5bbd7a4f420d)
(cherry picked from commit 3a417a86b330b7c1acf9db4f729be7d619caaded)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
(cherry picked from commit e032e647dd79e7748145792dfee0358eccb1982e)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2015-03-08 22:11:31 -04:00
Andreas Cadhalpun
3756b306a2 rmenc: limit packet size
The chunk size is limited to UINT16_MAX (written by avio_wb16), so make
sure that the packet size is not too large.

Such large frames need to be split into slices smaller than 64 kB, but
that is currently supported neither by the rv10/rv20 encoders nor the rm
muxer.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-03-08 20:34:03 +00:00
Andreas Cadhalpun
ded9931d16 rv10: check size of s->mb_width * s->mb_height
If it doesn't fit into 12 bits it triggers an assertion.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-03-08 20:33:57 +00:00
Federico Tomassetti
c17da32ba2 eamad: check for out of bounds read
Bug-Id: CID 1257500
CC: libav-stable@libav.org

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-03-08 19:41:12 +00:00
Martin Storsjö
9841654c15 arm: Suppress tags about used cpu arch and extensions
When all the codepaths using manually set .arch/.fpu code is
behind runtime detection, the elf attributes should be suppressed.

This allows tools to know that the final built binary doesn't
strictly require these extensions.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit dcae2e32f7d8a1ca5fb8c1e4aa81313be854dd73
and b77e335e441040a40fc6156b8e4a134745d10233)
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-03-08 18:12:19 +02:00
Reinhard Tartler
42eaec076b Prepare for 9.18 Release 2015-03-08 11:25:19 -04:00
Reinhard Tartler
473281193b Update Changelog for v9.18 2015-03-08 11:24:45 -04:00
Vittorio Giovara
11f98c83d1 img2dec: correctly use the parsed value from -start_number
Previously the image sequence was always starting from the minimum
number rather than the requested one.

CC: libav-stable@libav.org
2015-02-23 00:04:11 +00:00
Michael Niedermayer
eb1aa871d4 h264_cabac: Break infinite loops
This fixes out of array reads and/or infinite loops.

30 is the maximum number of bits that can be read into
coeff_abs below.

CC: libav-stable@libav.org
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-02-23 00:04:11 +00:00
Xiaohan Wang
6222ee068e matroskadec: Fix read-after-free in matroska_read_seek()
In matroska_read_seek(), |tracks| is assigned at the begining of the
function. However, functions like matroska_parse_cues() could reallocate
the tracks and invalidate |tracks|.

This assigns |tracks| only before using it, so that it will not get
invalidated elsewhere.

Bug-Id: chromium/427266
2015-01-27 14:36:12 +00:00
Michael Niedermayer
c5f52a9440 Update for 1.1.15
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-21 04:51:41 +01:00
Michael Niedermayer
45509d0730 avcodec/indeo3: ensure offsets are non negative
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 368642361f3a589d7b0c23ea327d988edb434e3f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-21 04:40:35 +01:00
Michael Niedermayer
e78e2dc6e1 avcodec/indeo3: use signed variables to avoid underflow
Fixes out of array read
Fixes: signal_sigsegv_1b0a4da_1865_cov_2167818389_computer_anger.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3305acdc92fa37869f160a11a87741c8a0de0454)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-21 04:40:35 +01:00
Michael Niedermayer
dc1cf5febb swscale: increase yuv2rgb table headroom
Fixes out of array access
Fixes: case2_bad_read_yuv2rgbx32.mp4
Found-by: Michal Zalewski <lcamtuf@coredump.cx>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-21 04:40:35 +01:00
Michael Niedermayer
2c5898c1d3 avformat/mov: check atom nesting depth
Fixes call stack overflow
Fixes: case1_call_stack_overflow.mp4
Found-by: Michal Zalewski <lcamtuf@coredump.cx>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit caa7a3914f499f74b3ee346f26d598ebdc0ec210)

Conflicts:

	libavformat/isom.h
2014-12-21 04:40:35 +01:00
Michael Niedermayer
b9d2c2e987 avcodec/utvideodec: Fix handling of slice_height=0
Fixes out of array accesses
Fixes: asan_heap-oob_25bcd7e_3783_cov_3553517262_utvideo_rgba_median.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3881606240953b9275a247a1c98a567f3c44890f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-21 04:40:35 +01:00
Michael Niedermayer
24fefa73db avcodec/vmdvideo: Check len before using it in method 3
Fixes out of array access
Fixes: asan_heap-oob_4d23ba_91_cov_3853393937_128.vmd

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

Conflicts:

	libavcodec/vmdav.c
2014-12-21 04:40:35 +01:00
Michael Niedermayer
9189ae8ff4 avformat/aviobuf: Check that avio_seek() target is non negative
Fixes out of array access

Suggested-by: Andrew Scherkus <scherkus@google.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ed86dbd05d61363dc1c0d33f3267e2177c985fdd)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-21 04:40:35 +01:00
Rob Sykes
7520f1fb3a swresample/soxr_resample: fix error handling
Fixes CID1257659

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-21 04:40:35 +01:00
wm4
437e50b3d6 avformat/matroskadec: fix handling of recursive SeekHead elements
When matroska_execute_seekhead() is called, it goes through the list of
seekhead entries and attempts to read elements not read yet. When doing
this, the parser can find further SeekHead elements, and will extend the
matroska->seekhead list. This can lead to a (practically) infinite loop
with certain broken files. (Maybe it can happen even with valid files.
The demuxer doesn't seem to check correctly whether an element has
already been read.)

Fix this by ignoring elements that were added to the seekhead field
during executing seekhead entries.

This does not fix the possible situation when multiple SeekHead elements
after the file header (i.e. occur after the "before_pos" file position)
point to the same elements. These elements will probably be parsed
multiple times, likely leading to bugs.

Fixes ticket #4162.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-21 04:40:35 +01:00
Michael Niedermayer
b3e98715c0 swscale/x86/rgb2rgb_template: fix crash with tiny size and nv12 output
Fixes Ticket4151

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-21 04:40:35 +01:00
Michael Niedermayer
ed75a9a60e avformat/rmdec: Check codec_data_size
Fixes infinite loop
Fixes Ticket4154

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-21 04:40:35 +01:00
Michael Niedermayer
33d74e62c2 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
2014-12-21 04:40:35 +01:00
Michael Niedermayer
2fcfcd5c87 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
2014-12-21 04:40:35 +01:00
Michael Niedermayer
46dfd59ae1 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>
2014-12-21 04:40:35 +01:00
Michael Niedermayer
07b98ea396 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)

Conflicts:

	libavcodec/mjpegdec.c
2014-12-21 04:40:35 +01:00
Michael Niedermayer
b4f08f34a8 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>
2014-12-21 04:40:35 +01:00
Michael Niedermayer
c1e048dffe 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>
2014-12-21 04:40:34 +01:00
Michael Niedermayer
ce35c10b88 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>
2014-12-21 04:40:34 +01:00
Michael Niedermayer
3535f0867e 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

Conflicts:

	libavcodec/h264.c
2014-12-21 04:40:34 +01:00
Michael Niedermayer
6c5a57db94 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)

Conflicts:

	libavcodec/svq1dec.c
2014-12-21 04:40:34 +01:00
Michael Niedermayer
961bbb98cf 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>
2014-12-21 04:40:34 +01:00
Michael Niedermayer
e43872c3a9 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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-21 04:40:34 +01:00
Michael Niedermayer
251d66d746 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)

Conflicts:

	libavcodec/dxa.c

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-21 04:40:34 +01:00
Michael Niedermayer
26dddec466 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>
2014-12-21 04:40:34 +01:00
Michael Niedermayer
03ea398227 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>
2014-12-21 04:40:34 +01:00
Michael Niedermayer
f6cfd160ca 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>
2014-12-21 04:40:34 +01:00
Michael Niedermayer
5e8b8e4b9d 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>
2014-12-21 04:40:34 +01:00
Michael Niedermayer
86e5769525 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>
2014-12-21 04:40:04 +01:00
Michael Niedermayer
d37e539d5e avcodec/pngdec: Calculate MPNG bytewidth more defensively
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e830902934a29df05c7af65aef2a480b15f572c4)

Conflicts:

	libavcodec/pngdec.c
2014-12-21 04:40:04 +01:00
Michael Niedermayer
0b99a18ebc 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>
2014-12-21 04:40:04 +01:00
Michael Niedermayer
aa17021e81 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)

Conflicts:

	libavcodec/tiff.c
2014-12-21 04:40:04 +01:00
Michael Niedermayer
d68ae96ea8 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)

Conflicts:

	libavcodec/mmvideo.c

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-21 04:40:04 +01:00
Michael Niedermayer
37800352bb 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>
2014-12-21 04:40:03 +01:00
Michael Niedermayer
29abba3572 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
(cherry picked from commit 94371a404c663c3dae3d542fa43951567ab67f82)

Conflicts:

	libavcodec/mjpegdec.c
2014-12-21 04:40:03 +01:00
Michael Niedermayer
d44d87e172 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>
2014-12-21 04:40:03 +01:00
Reimar Döffinger
0872359f9f 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>
2014-12-21 04:40:03 +01:00
Michael Niedermayer
135a09c46e 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>
2014-12-21 04:40:03 +01:00
lvqcl
1eb59e4d54 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>
2014-12-21 04:40:03 +01:00
Michael Niedermayer
a76198ed28 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>
2014-12-21 04:40:03 +01:00
Michael Niedermayer
66b1f5894a 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)

Conflicts:

	libavcodec/mpegvideo.c
2014-12-21 04:40:03 +01:00
Michael Niedermayer
91c3a829a4 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>
2014-12-21 04:40:03 +01:00
Michael Niedermayer
a2933aa59a 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>
2014-12-21 04:40:03 +01:00
Michael Niedermayer
857eaa45ba 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>
2014-12-21 04:40:03 +01:00
Michael Niedermayer
8df5b0250d 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>
2014-12-21 04:40:03 +01:00
Michael Niedermayer
c633427e92 Merge commit '306ee95088243fefa2dfcb5c355d439db75e2d2a' into release/1.1
* commit '306ee95088243fefa2dfcb5c355d439db75e2d2a':
  smc: fix the bounds check

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-21 04:35:19 +01:00
Michael Niedermayer
0ee7505e63 Merge commit '02de44073a8e116ea177b53081219d32ef135ad8' into release/1.1
* commit '02de44073a8e116ea177b53081219d32ef135ad8':
  gifdec: refactor interleave end handling

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-21 04:35:02 +01:00
Michael Niedermayer
9bbe24d455 Merge commit '03dba25a4001495226651068232b4c6b1e75fd02' into release/1.1
* commit '03dba25a4001495226651068232b4c6b1e75fd02':
  mmvideo: check frame dimensions

Conflicts:
	libavcodec/mmvideo.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-21 04:29:22 +01:00
Michael Niedermayer
6e5dd43bf9 Merge commit '50cb695bf124b0bd4d9e2b3c1bfdd08b35b14438' into release/1.1
* commit '50cb695bf124b0bd4d9e2b3c1bfdd08b35b14438':
  jvdec: check frame dimensions

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-21 04:28:28 +01:00
Michael Niedermayer
5e16809d49 Merge commit '93f919d0b4c4341ccee366c98ac9af813f8fe622' into release/1.1
* commit '93f919d0b4c4341ccee366c98ac9af813f8fe622':
  mov: avoid a memleak when multiple stss boxes are present

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-21 04:23:02 +01:00
Michael Niedermayer
7a6907fcc3 Merge commit 'ce424e57d629072652935501b439c1a6310c2089' into release/1.1
* commit 'ce424e57d629072652935501b439c1a6310c2089':
  mp3enc: fix a triggerable assert

Conflicts:
	libavformat/mp3enc.c

Changed code is not in FFmpeg

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-21 04:22:30 +01:00
Michael Niedermayer
74e52afe8f Merge commit '489c180451b1cde469f6aeea44f8bdb11cd941d0' into release/1.1
* commit '489c180451b1cde469f6aeea44f8bdb11cd941d0':
  Add some bug references to the changelog

Conflicts:
	Changelog

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-21 04:21:01 +01:00
Michael Niedermayer
8eaecab5f4 Merge commit '56ac2cbd0464e0146e62c91843e2b1f5e0908504' into release/1.1
* commit '56ac2cbd0464e0146e62c91843e2b1f5e0908504':
  apetag: Fix APE tag size check

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-21 04:07:26 +01:00
Michael Niedermayer
c7b8f02940 Merge commit '606bbd50b1ebaa3c040fc7cab84f1d8bb5d3d248' into release/1.1
* commit '606bbd50b1ebaa3c040fc7cab84f1d8bb5d3d248':
  Update Changelog for v9.17

Conflicts:
	Changelog

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-21 04:06:49 +01:00
Michael Niedermayer
8a9feeff9e Merge commit '2cd5640bce0ee8f515ff05040ce1c18d6af2694c' into release/1.1
* commit '2cd5640bce0ee8f515ff05040ce1c18d6af2694c':
  Prepare for 9.17 release

Conflicts:
	RELEASE

Not merged

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-21 04:06:01 +01:00
Michael Niedermayer
2b8effcda3 Merge commit '9920a8a83f578821e00212da6b79c8997a725fa8' into release/1.1
* commit '9920a8a83f578821e00212da6b79c8997a725fa8':
  doc: Fix syntax and logical errors in avconv stream combination example

Conflicts:
	doc/ffmpeg.texi

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-21 04:04:48 +01:00
Michael Niedermayer
306ee95088 smc: fix the bounds check
Fixes invalid writes when there are more blocks in a run than total
remaining blocks.

CC: libav-stable@libav.org
Bug-ID: CVE-2014-8548
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit d423dd72be451462c6fb1cbbe313bed0194001ab)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 58dc526ebf722d33bf09275c1241674e0e6b9ef1)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit f249e9889155599ee3ad0172832d38f68b0c625d)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-20 11:11:46 +01:00
Michael Niedermayer
02de44073a gifdec: refactor interleave end handling
Fixes invalid writes with very small image heights.

CC: libav-stable@libav.org
Bug-ID: CVE-2014-8547
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 0b39ac6f54505a538c21fe49a626de94c518c903)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit eac49477aa95cf727d87d2741ee8e60be59d394b)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 92888e9ed4ea4e761ae953bbe28c85cc658abc8f)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-20 11:11:42 +01:00
Anton Khirnov
03dba25a40 mmvideo: check frame dimensions
The frame size must be set by the caller and each dimension must be a
multiple of 2.

CC: libav-stable@libav.org
Bug-ID: CVE-2014-8543
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
(cherry picked from commit 17ba719d9ba30c970f65747f42d5fbb1e447ca28)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 69a930b988ff4f88ae27e4fc24ff6ed116840b5e)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 3f10a779b465fd22d3aec1b744ca8544bc2da970)
Signed-off-by: Anton Khirnov <anton@khirnov.net>

Conflicts:
	libavcodec/mmvideo.c
2014-12-20 11:11:26 +01:00
Anton Khirnov
50cb695bf1 jvdec: check frame dimensions
The frame size must be set by the caller and each dimension must be a
multiple of 8.

CC: libav-stable@libav.org
Bug-ID: CVE-2014-8542
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
(cherry picked from commit 88626e5af8d006e67189bf10b96b982502a7e8ad)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 55788572ea7b89cdd77bab1cf4bf06d14ead34f5)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 8f238dd9bdd9eba569fcaa564a07fbdd89412a14)
Signed-off-by: Anton Khirnov <anton@khirnov.net>

Conflicts:
	libavcodec/jvdec.c
2014-12-20 11:10:32 +01:00
Anton Khirnov
93f919d0b4 mov: avoid a memleak when multiple stss boxes are present
CC: libav-stable@libav.org
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
(cherry picked from commit 64f7575fbd64e5b65d5c644347408588c776f1fe)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 577f1feb3fd1e51fd14af7ce6d79d468faa3b929)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 931f5b235112f1c2a09dead36f0a228061d23942)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-20 11:09:46 +01:00
Anton Khirnov
ce424e57d6 mp3enc: fix a triggerable assert
We have to check against the number of bytes actually needed, not the
theoretical maximum size.

(cherry picked from commit 12700b0219521a5f20c8ba47b3ad7857ea9e0554)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 871d99ef77336069e5a8ece947c8160d9bc4d5ea)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-11-15 08:51:50 +01:00
Diego Biurrun
489c180451 Add some bug references to the changelog 2014-09-26 03:16:52 -07:00
Katerina Barone-Adesi
56ac2cbd04 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.

(cherry picked from commit d14696c99ccac12a052ce10e70859ffc0293ed6a)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-09-17 07:22:08 -07:00
Diego Biurrun
606bbd50b1 Update Changelog for v9.17 2014-09-10 12:58:33 -07:00
Diego Biurrun
2cd5640bce Prepare for 9.17 release 2014-09-10 12:58:01 -07:00
Diego Biurrun
9920a8a83f doc: Fix syntax and logical errors in avconv stream combination example
Bug-Id: 661
CC: libav-stable@libav.org
(cherry picked from commit 775a0b04f0cf8102fe322b2ee03fe1a0633dea04)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-09-10 12:08:22 -07:00
Piotr Bandurski
f3c8a8b087 avcodec/lcldec: fix decoding of YUV444 sample
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a3329a09f93455a44ff3c9c64886c4da1f66bcfb)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-30 21:56:15 +02:00
Christophe Gisquet
60f94f7084 alacenc: fix extra bits extraction
The raw coded bits are extracted prior to decorrelation, as is correctly
performed by the decoder, and not after.

Fixes ticket #2768.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-30 21:53:11 +02:00
Christophe Gisquet
7f7cf051ed alacenc: increase predictor buffer
This change is almost cosmetical only, and reduces the changes needed to
fix the 24bps case.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-30 21:53:06 +02:00
Christophe Gisquet
3231e7ab64 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>
2014-08-30 21:52:07 +02:00
Jon Morley
552fe9b07f avcodec/adpcm: Fix incorrect AVSampleFormat for sample_fmts_s16p
The AVSampleFormat list of sample_fmts_s16p is missing the trailing "P" for planar formats. AV_SAMPLE_FMT_S16 vs AV_SAMPLE_FMT_S16P

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-30 21:51:05 +02:00
Michael Niedermayer
3ed4dc9228 version.sh: Print versions based on the last git tag for release branches
release branches are detected by checking if "git" is not in RELEASE
This changes "N-64706-g2f71aeb" to "n2.3-8-g2f71aeb"
for git master theres no change

This should improve the readability of lists of versions which come from
more than 1 release branch or master + release. fate.ffmpeg.org is
one possible example

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

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

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-30 21:44:59 +02:00
Michael Niedermayer
4ede955d86 remove VERSION file
it overrides what version.sh prints and thus makes its output
from release branches rather useless

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

Conflicts:

	VERSION
(cherry picked from commit f543d32455a30c7e11206241184dfb16b8a8081c)

Conflicts:

	VERSION
(cherry picked from commit 59b2a9ef957ec796ccf457aad263a52bc457b610)

Conflicts:

	VERSION

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-30 21:44:52 +02:00
Michael Niedermayer
195fcbff2b Update for 1.1.14
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-30 21:44:13 +02:00
Michael Niedermayer
96d1a8f014 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>
2014-08-30 21:37:43 +02:00
Michael Niedermayer
0bf0de7185 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>
2014-08-30 21:33:09 +02:00
Michael Niedermayer
c58d7f9eb5 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>
2014-08-30 21:33:09 +02:00
Christophe Gisquet
11a61dd0e2 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>
2014-08-30 21:13:11 +02:00
Michael Niedermayer
5865d599c3 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)

Conflicts:

	libavcodec/iff.c
(cherry picked from commit 656f930160db48e0b7b25069c62abc340e7f0628)

Conflicts:

	libavcodec/iff.c
(cherry picked from commit abc1fa7c5a1dca1345b9471b81cfcda00c56220d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-30 21:13:11 +02:00
Michael Niedermayer
d03fd2c805 Merge commit '124ec8b1303d4f29b833099ce9008e31ac6d7c86' into release/1.1
* commit '124ec8b1303d4f29b833099ce9008e31ac6d7c86':
  pulse: Add a wallclock option to be compatible with other other captures

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-30 21:07:56 +02:00
Michael Niedermayer
946a106995 Merge commit 'e1f0c41e1aa37a9c166c43abf1b526c796ed7649' into release/1.1
* commit 'e1f0c41e1aa37a9c166c43abf1b526c796ed7649':
  avconv: fix parsing the AVOptions for -target

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-30 20:58:53 +02:00
Michael Niedermayer
fed28fe054 Merge commit '8d7839fc7c52574dfc22db0181b1cef9cb929910' into release/1.1
* commit '8d7839fc7c52574dfc22db0181b1cef9cb929910':
  avconv: fix the muxrate values for -target

Conflicts:
	ffmpeg_opt.c

No change, as ffmpegs muxrate is in bits/sec

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-30 20:58:25 +02:00
Michael Niedermayer
0a6d397911 Merge commit 'bbd632082b18e6c5ce9c2d6be8bc260c05ae9417' into release/1.1
* commit 'bbd632082b18e6c5ce9c2d6be8bc260c05ae9417':
  mpegenc: limit the maximum muxrate

Conflicts:
	libavformat/mpegenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-30 20:50:50 +02:00
Michael Niedermayer
081f4f5f56 Merge commit 'e4fb53c73abece15a7c5df0019df9a0371db2297' into release/1.1
* commit 'e4fb53c73abece15a7c5df0019df9a0371db2297':
  ffv1dec: check that global parameters do not change in version 0/1

Conflicts:
	libavcodec/ffv1dec.c

See: f78a3868fd3d8f66da68338c0783aa15f98833bf
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-30 20:47:54 +02:00
Michael Niedermayer
f953c3c234 Merge commit 'bd41211395fd1f968e9f3a4746daffebea60f41e' into release/1.1
* commit 'bd41211395fd1f968e9f3a4746daffebea60f41e':
  Re-release 9.15 as 9.16
  Prepare for 9.15 Release
  Update Changelog for v9.15

Conflicts:
	Changelog
	RELEASE

Not merged, as the versions are different in FFmpeg

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-30 20:38:41 +02:00
Michael Niedermayer
dcce698fd8 Merge commit '437848e37ae7ef73cd8101031dc570d1f009ffd5' into release/1.1
* commit '437848e37ae7ef73cd8101031dc570d1f009ffd5':
  vp3: Copy all 3 frames for thread updates

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

Conflicts:
	libavformat/mpegtsenc.c

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

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-30 20:20:01 +02:00
Luca Barbato
124ec8b130 pulse: Add a wallclock option to be compatible with other other captures
alsa and x11grab use av_gettime() to report timestamps.

Have it on by default.

Bug-Id: 647
(cherry picked from commit 424b929b5cb9ca4094099f25179829260d4b0fa3)
(cherry picked from commit 404731bd20e1df5880e6fe381e975ba48afc75b2)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-08-28 12:10:44 +02:00
Anton Khirnov
e1f0c41e1a avconv: fix parsing the AVOptions for -target
CC: libav-stable@libav.org
(cherry picked from commit f5245a9c6206878b892adf3ccbccc9311c202af5)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit f7395926f204051af9ad459a6d876b96ee6179ee)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-27 06:37:00 +00:00
Anton Khirnov
8d7839fc7c avconv: fix the muxrate values for -target
The mpegenc private option values are in 50-byte units.

CC: libav-stable@libav.org
(cherry picked from commit 1688eef25385089026aba55da1885f70a57815ab)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 7bc37641e3e6c24d472ae06fcbecaba4c863829b)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-27 06:36:55 +00:00
Anton Khirnov
bbd632082b mpegenc: limit the maximum muxrate
It is written to the file as a 22-bit value.

CC: libav-stable@libav.org
(cherry picked from commit 75bbaf2493a71ee66eaabe3c21fadd84d07888de)
Signed-off-by: Anton Khirnov <anton@khirnov.net>

Conflicts:
	libavformat/mpegenc.c

(cherry picked from commit 3ac0638d573fc483ba6be3444858b26711c5d67d)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-27 06:36:48 +00:00
Michael Niedermayer
e4fb53c73a ffv1dec: check that global parameters do not change in version 0/1
Such changes are neither allowed nor supported

Found-by: ami_stuff
Bug-Id: CVE-2013-7020
CC: libav-stable@libav.org
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit da7d839a0d3ec40423a665dc85e0cfaed3f92eb8)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-12 10:35:09 +00:00
Reinhard Tartler
bd41211395 Re-release 9.15 as 9.16
This is a clean fixup of the tagging mistake in the v9.15 release
2014-08-09 08:55:45 -04:00
Reinhard Tartler
e86074e6ef Prepare for 9.15 Release 2014-08-08 21:57:46 -04:00
Reinhard Tartler
8da037af33 Update Changelog for v9.15 2014-08-08 20:46:15 -04:00
Michael Niedermayer
41e8591515 update for 1.1.13
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-08 22:45:52 +02:00
Michael Niedermayer
a04bb8d6e7 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>
2014-08-08 16:19:48 +02:00
Michael Niedermayer
1298aa8318 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>
2014-08-08 16:19:48 +02:00
Michael Niedermayer
e5fcc16a1f 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>
2014-08-08 16:19:48 +02: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
b52952c6e9 Merge commit 'ecda9b90eccc687202fe9fa20f7ca61d92d816b4' into release/1.1
* commit 'ecda9b90eccc687202fe9fa20f7ca61d92d816b4':
  Update Changelog for v9.15

Conflicts:
	Changelog

Not merged as the changelog doesnt apply 1:1 to FFmpeg

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-08 16:08:16 +02:00
Michael Niedermayer
b65c290f7f Merge commit '52254067b312e78d30bbe79fc33dbdf995b22b4e' into release/1.1
* commit '52254067b312e78d30bbe79fc33dbdf995b22b4e':
  error_concealment: avoid using the picture if not fully setup

Conflicts:
	libavcodec/error_resilience.c

See: 68a0477bc0af026db971ddba22541029a9e8715b
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-08 16:06:27 +02:00
Michael Niedermayer
437848e37a vp3: Copy all 3 frames for thread updates
Fixes a double release of the current frame on deinit.

Bug-Id: CVE-2011-3934
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-08-08 14:57:01 +01:00
Michael Niedermayer
09e3fe79fc avcodec/svq1dec: Fix multiple bugs from "svq1: do not modify the input packet"
Add padding, clear size, use the correct pointer.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-08 15:49:50 +02:00
Michael Niedermayer
e4b1cffade Merge commit 'af9b62654d5aa023a96906215365532d18541a09' into release/1.1
* commit 'af9b62654d5aa023a96906215365532d18541a09':
  svq1: do not modify the input packet

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-08 15:48:57 +02:00
Michael Niedermayer
06f7e87e15 Merge commit '80c268eaaee402695a74d14acf76063100692a99' into release/1.1
* commit '80c268eaaee402695a74d14acf76063100692a99':
  cdgraphics: do not return 0 from the decode function

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-08 15:47:34 +02:00
Michael Niedermayer
420f63984b Merge commit '8cd67ddde46a42a33149e7d42a2ab47852ff2a83' into release/1.1
* commit '8cd67ddde46a42a33149e7d42a2ab47852ff2a83':
  cdgraphics: switch to bytestream2

Conflicts:
	libavcodec/cdgraphics.c

See: ad002e1a13a8df934bd6cb2c84175a4780ab8942
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-08 15:45:19 +02:00
Michael Niedermayer
91437631d7 Merge commit 'c53effc41b9359261b17c8da3b7062369cafd686' into release/1.1
* commit 'c53effc41b9359261b17c8da3b7062369cafd686':
  huffyuvdec: check width size for yuv422p

Conflicts:
	libavcodec/huffyuvdec.c

See: 6abb9a901fca27da14d4fffbb01948288b5da3ba
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-08 15:20:18 +02:00
Michael Niedermayer
0d6ed2f13f Merge commit 'ede738880032db62b7dc5b3712f769d3826f5974' into release/1.1
* commit 'ede738880032db62b7dc5b3712f769d3826f5974':
  mmvideo: check horizontal coordinate too

See: See: 8d3c99e825317b7efda5fd12e69896b47c700303
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-08 15:17:14 +02:00
Michael Niedermayer
a88236f3d5 Merge commit '36d8914f1b94e4731d2fc67162902839c106e72e' into release/1.1
* commit '36d8914f1b94e4731d2fc67162902839c106e72e':
  wmalosslessdec: fix mclms_coeffs* array size

See: ec9578d54d09b64bf112c2bf7a34b1ef3b93dbd3
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-08 14:57:28 +02:00
Michael Niedermayer
02018a359e Merge commit '146b187113e3cc20c2a97c5f264da13e701ca247' into release/1.1
* commit '146b187113e3cc20c2a97c5f264da13e701ca247':
  lavc: Check the image size before calling get_buffer

Conflicts:
	libavcodec/utils.c

See: 668494acd8b20f974c7722895d4a6a14c1005f1e
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-08 14:54:53 +02:00
Michael Niedermayer
451bc8ee2f Merge commit '43d676432740c6d5e5234ed343f13902909fd124' into release/1.1
* commit '43d676432740c6d5e5234ed343f13902909fd124':
  huffyuv: Check and propagate function return values

Conflicts:
	libavcodec/huffyuvdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-08 14:38:20 +02:00
Michael Niedermayer
ae7ea2eabf Merge commit '512354191328c559fcff56070dab897ee2a1b4c1' into release/1.1
* commit '512354191328c559fcff56070dab897ee2a1b4c1':
  h264: prevent theoretical infinite loop in SEI parsing

Conflicts:
	libavcodec/h264_sei.c

See: 9decfc17bb76da34734296048d390b176abf404c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-08 14:33:21 +02:00
Michael Niedermayer
0bcf514198 Merge commit '01f9540320279954b2764645ab7136847d53d89f' into release/1.1
* commit '01f9540320279954b2764645ab7136847d53d89f':
  h264_sei: check SEI size

Conflicts:
	libavcodec/h264_sei.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-08 14:24:54 +02:00
Michael Niedermayer
1ee5e2ce3d Merge commit '00915d3cd2ce61db3d6dc11f63566630a9aff4ec' into release/1.1
* commit '00915d3cd2ce61db3d6dc11f63566630a9aff4ec':
  pgssubdec: Check RLE size before copying

See: c0d68be555f5858703383040e04fcd6529777061
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-08 14:20:41 +02:00
Michael Niedermayer
6e83c26620 Merge commit '58d7b835e3cec48ab5a2393405fe82dee72c06a0' into release/1.1
* commit '58d7b835e3cec48ab5a2393405fe82dee72c06a0':
  fate: Add dependencies for dct/fft/mdct/rdft tests

Conflicts:
	libavcodec/fft-test.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-08 14:14:06 +02:00
Michael Niedermayer
a4de70df20 Merge commit 'd16515ae5fe7daa6327d903cafb9a5ee43477b1e' into release/1.1
* commit 'd16515ae5fe7daa6327d903cafb9a5ee43477b1e':
  video4linux2: Avoid a floating point exception

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-08 14:13:40 +02:00
Michael Niedermayer
eaf64192d8 Merge commit '3a6bc3e381647bb4434317113f131f7e0ab5bf83' into release/1.1
* commit '3a6bc3e381647bb4434317113f131f7e0ab5bf83':
  vf_select: Drop a debug av_log with an unchecked double to enum conversion

Conflicts:
	libavfilter/f_select.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-08 14:06:36 +02:00
Michael Niedermayer
c074feed29 Merge commit 'e8ff7972064631afbdf240ec6bfd9dec30cf2ce8' into release/1.1
* commit 'e8ff7972064631afbdf240ec6bfd9dec30cf2ce8':
  eamad: use the bytestream2 API instead of AV_RL

Conflicts:
	libavcodec/eamad.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-08 13:55:06 +02:00
Michael Niedermayer
53c3abc108 Merge commit '3ecbd911ff9177097820e5d00401c9bf29e5d167' into release/1.1
* commit '3ecbd911ff9177097820e5d00401c9bf29e5d167':
  Update Changelog for v9.14
  Prepare for 9.14 Release

Conflicts:
	Changelog
	RELEASE

Not merged as this doesnt apply 1:1 to our releases

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-08 13:48:19 +02:00
Michael Niedermayer
6333c6c17d Merge commit '21d3e0ac9e1719d8444b3f5466983587ac0ad240' into release/1.1
* commit '21d3e0ac9e1719d8444b3f5466983587ac0ad240':
  adpcm: Write the proper predictor in trellis mode in IMA QT

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-08 13:32:56 +02:00
Michael Niedermayer
5fa56e6e62 Merge commit '744e7eea5d815efea777b6179d96e8d94b63ccfa' into release/1.1
* commit '744e7eea5d815efea777b6179d96e8d94b63ccfa':
  adpcm: Avoid reading out of bounds in the IMA QT trellis encoder

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-08 13:31:09 +02:00
Michael Niedermayer
cf7f798984 Merge commit 'd7dbc687e312a91ef2ccf797d57b95c61d0e8a2f' into release/1.1
* commit 'd7dbc687e312a91ef2ccf797d57b95c61d0e8a2f':
  Check mp3 header before calling avpriv_mpegaudio_decode_header().

Conflicts:
	libavformat/mp3enc.c

See: See: 2dd0da787ce5008d4d1b8f461fbd1288c32e2c38
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-08 12:52:20 +02:00
Michael Niedermayer
244a58fff0 Merge commit '7997acee0542f6e0bb9ea42ff783f80b70878a2f' into release/1.1
* commit '7997acee0542f6e0bb9ea42ff783f80b70878a2f':
  Check if an mp3 header is using a reserved sample rate.

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

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

Bug-Id: CVE-2014-2263
CC: libav-stable@libav.org
2014-08-07 20:07:31 +02:00
Luca Barbato
694b7cd873 mpegts: Define the section length with a constant
The specification says the value is expressed in 10 bits including
the 4-byte CRC.
2014-08-07 13:30:21 +02:00
Reinhard Tartler
ecda9b90ec Update Changelog for v9.15 2014-08-06 20:07:33 -04:00
Michael Niedermayer
52254067b3 error_concealment: avoid using the picture if not fully setup
Fixes state becoming inconsistent and a null pointer dereference.

CC: libav-stable@libav.org
Bug-Id: CVE-2013-0860
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-06 19:25:56 +00:00
Anton Khirnov
af9b62654d svq1: do not modify the input packet
The input data must remain constant, make a copy instead. This is in
theory a performance hit, but since I failed to find any samples
using this feature, this should not matter in practice.

Also, check the size of the header, avoiding invalid reads on truncated
data.

CC:libav-stable@libav.org
(cherry picked from commit 7b588bb691644e1b3c168b99accf74248a24e3cf)
Signed-off-by: Anton Khirnov <anton@khirnov.net>

Conflicts:
	libavcodec/svq1dec.c
2014-08-06 19:10:28 +00:00
Anton Khirnov
80c268eaae 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: Anton Khirnov <anton@khirnov.net>

Conflicts:
	libavcodec/cdgraphics.c
2014-08-06 18:46:36 +00:00
Anton Khirnov
8cd67ddde4 cdgraphics: switch to bytestream2
Fixes possible invalid memory accesses on corrupted data.

CC:libav-stable@libav.org
Bug-ID: CVE-2013-3674
(cherry picked from commit a1599f3f7ea8478d1f6a95e59e3bc6bc86d5f812)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-06 18:45:57 +00:00
Michael Niedermayer
c53effc41b huffyuvdec: check width size for yuv422p
Avoid out of array accesses.

CC: libav-stable@libav.org
Bug-Id: CVE-2013-0848
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit a7153444df9040bf6ae103e0bbf6104b66f974cb)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-05 20:11:08 +00:00
Michael Niedermayer
ede7388800 mmvideo: check horizontal coordinate too
Fixes out of array accesses.

Bug-Id: CVE-2013-3672
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 70cd3b8e659c3522eea5c16a65d14b8658894a94)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-05 19:28:47 +00:00
Michael Niedermayer
36d8914f1b wmalosslessdec: fix mclms_coeffs* array size
Fixes corruption of context

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
Bug-Id: CVE-2014-2098
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 849b9d34c7ef70b370c53e7af3940f51cbc07d0f)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-05 15:05:22 +00:00
Luca Barbato
146b187113 lavc: Check the image size before calling get_buffer
Bug-Id: CVE-2011-3935
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
2014-08-04 14:15:45 +02:00
Diego Biurrun
43d6764327 huffyuv: Check and propagate function return values
Bug-Id: CVE-2013-0868

inspired by a patch from Michael Niedermayer <michaelni@gmx.at>
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind

(cherry picked from commit 744b406ff3474e77543bcf86125a2f7bc7deaa18)
Signed-off-by: Diego Biurrun <diego@biurrun.de>

Conflicts:
	libavcodec/huffyuvdec.c
2014-08-03 16:08:59 -07:00
Vittorio Giovara
5123541913 h264: prevent theoretical infinite loop in SEI parsing
Properly address CVE-2011-3946 and parse bitstream as described in the spec.

CC: libav-stable@libav.org
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
2014-08-01 13:36:37 +01:00
Michael Niedermayer
01f9540320 h264_sei: check SEI size
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-08-01 13:36:37 +01:00
Michael Niedermayer
00915d3cd2 pgssubdec: Check RLE size before copying
Make sure the buffer size does not exceed the expected
RLE size.

Prevent an out of array bound write.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Bug-Id: CVE-2013-0852

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit a1f7844a11010d8552c75424d1a831b37a0ae5d9)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-08-01 05:12:07 -07:00
Diego Biurrun
58d7b835e3 fate: Add dependencies for dct/fft/mdct/rdft tests
(cherry picked from commit d396987c303bdc4eea7d1a1ff6776475d9bbd9ea)
Signed-off-by: Diego Biurrun <diego@biurrun.de>

Conflicts:
	libavcodec/fft-test.c
2014-07-30 12:15:44 -07:00
Bernhard Übelacker
d16515ae5f video4linux2: Avoid a floating point exception
This avoids a segfault in avconv_opt.c:opt_target when trying to
determine the norm.

(cherry picked from commit dc71f1958846bb1d96de43a4603983dc8450cfcc)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-07-30 12:15:44 -07:00
Diego Biurrun
3a6bc3e381 vf_select: Drop a debug av_log with an unchecked double to enum conversion
CC: libav-stable@libav.org
(cherry picked from commit a8d803a320fb08b3ad5db4fffc79abd401206905)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-07-30 12:15:44 -07:00
Anton Khirnov
e8ff797206 eamad: use the bytestream2 API instead of AV_RL
This is safer and possibly fixes invalid reads on truncated data.
(cherry-picked from commit 541427ab4d5b4b6f5a90a687a06decdb78e7bc3c)

CC:libav-stable@libav.org

Conflicts:
	libavcodec/eamad.c

(cherry picked from commit f9204ec56a4cf73843d1e5b8563d3584c2c05b47)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-07-30 11:35:41 -07:00
Reinhard Tartler
3ecbd911ff Update Changelog for v9.14 2014-06-26 21:28:08 -04:00
Reinhard Tartler
5e8eaa26b2 Prepare for 9.14 Release 2014-06-26 21:23:39 -04:00
Martin Storsjö
21d3e0ac9e 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.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 0776e0ef6ba4160281ef3fabea43e670f3792b4a)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-06-26 13:43:46 +02:00
Martin Storsjö
744e7eea5d adpcm: Avoid reading out of bounds in the IMA QT trellis encoder
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].

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 3d79d0c93e5b37a35b1b22d6c18699c233aad1ba)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-06-26 13:43:41 +02:00
Justin Ruggles
d7dbc687e3 Check mp3 header before calling avpriv_mpegaudio_decode_header().
As indicated in the function documentation, the header MUST be
checked prior to calling it because no consistency check is done
there.

CC:libav-stable@libav.org
(cherry picked from commit f2f2e7627f0c878d13275af5d166ec5932665e28)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-06-26 12:52:01 +02:00
Justin Ruggles
7997acee05 Check if an mp3 header is using a reserved sample rate.
Fixes an invalid read past the end of avpriv_mpa_freq_tab.
Fixes divide-by-zero due to sample_rate being set to 0.

Bug-Id: 705

CC:libav-stable@libav.org

Conflicts:
	libavcodec/mpegaudiodecheader.c
2014-06-26 12:51:04 +02:00
Michael Niedermayer
4dfd4399ea Update for FFmpeg 1.1.12
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-26 00:13:49 +02:00
Michael Niedermayer
f0d56d4f55 avformat/mpc: attempt to allocate a packet that is not smaller than the data inside it
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 86a9370e2b91d67375e66a06d6eb573b5a017775)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-25 23:15:58 +02:00
Michael Niedermayer
71a4a9183f avcodec/alsdec: Clear MPEG4AudioConfig so that no use of uninitialized memory is possible
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6e6bd5481cf42a9765c492c77754d4633092cece)

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
bd2266975c avcodec/libvorbisenc: dont add the duration to AV_NOPTS_VALUE
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 19e66c7232d96e4ae8f05b52da2b84dfaa4e4da3)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-25 23:15:37 +02:00
Michael Niedermayer
e68114868f avutil/cpu: force mmx on selection of higher x86 SIMD features
Fixes various runtime failures with manually set flags that represent no
existing CPU

Fixes Ticket3653

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-25 23:15:37 +02:00
Michael Niedermayer
4533e8b30a avcodec/diracdec: move mc buffer allocation to per frame
Fixes out of array accesses for non default buffers with large strides

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-25 23:15:37 +02:00
Michael Niedermayer
a8dd7fe5b9 Merge commit '503322f97c5a25a020933ed4ab510697d5f5b4af' into release/1.1
* commit '503322f97c5a25a020933ed4ab510697d5f5b4af':
  lzo: Handle integer overflow

Conflicts:
	libavutil/lzo.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-25 22:40:30 +02:00
Luca Barbato
503322f97c lzo: Handle integer overflow
get_len can overflow for specially crafted payload.

Reported-By: Don A. Baley <donb@securitymouse.com>
CC: libav-stable@libav.org

(cherry picked from commit ccda51b14c0fcae2fad73a24872dce75a7964996)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-06-25 14:43:46 +02:00
Michael Niedermayer
574bf2ce4c avutil/lzo: add asserts to be double sure against overflows
These asserts cannot fail since d6af26c55c1ea30f85a7d9edbc373f53be1743ee

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-23 15:14:30 +02:00
Michael Niedermayer
1f2f6b247a avutil/lzo: Fix integer overflow
Embargoed-till: 2014-06-27 requested by researcher, but embargo broken by libav today (git and mailing list)

Fixes: LMS-2014-06-16-4
Found-by: "Don A. Bailey" <donb@securitymouse.com>
See: ccda51b14c0fcae2fad73a24872dce75a7964996
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d6af26c55c1ea30f85a7d9edbc373f53be1743ee)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-23 15:14:28 +02:00
Michael Niedermayer
724deeb7a8 Merge commit '4310ba273d3bcb7f19a4e40b55b9e832568e56e5' into release/1.1
* commit '4310ba273d3bcb7f19a4e40b55b9e832568e56e5':
  sgidec: fix an incorrect backport

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-20 01:26:57 +02:00
Michael Niedermayer
62899d79a3 Merge commit 'ba8ab4e7ae016cf970b0f335a7933f2db53784bc' into release/1.1
* commit 'ba8ab4e7ae016cf970b0f335a7933f2db53784bc':
  avconv: do not send non-monotonous DTS to the muxers.

Conflicts:
	ffmpeg_opt.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-20 01:11:54 +02:00
Michael Niedermayer
45283653a3 Merge commit 'e0fcad77618a0455ca9c2451ea0aa538597a08c0' into release/1.1
* commit 'e0fcad77618a0455ca9c2451ea0aa538597a08c0':
  avconv: make -shortest work with streamcopy

Conflicts:
	ffmpeg.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-20 01:05:46 +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
Sean McGovern
4310ba273d sgidec: fix an incorrect backport
Bug-Id: 691

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-06-17 21:44:38 +02:00
Anton Khirnov
ba8ab4e7ae avconv: do not send non-monotonous DTS to the muxers.
Hack partially based on a commit by Michael Niedermayer <michaelni@gmx.at>
Should fix (or work around) bug 458.
(cherry picked from commit 76d23f40314fc1dcd74a3d470b17782cc0ee5a3a)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-06-12 09:31:11 +02:00
Anton Khirnov
e0fcad7761 avconv: make -shortest work with streamcopy
CC: libav-stable@libav.org
(cherry picked from commit 48e50921337984ba4ec2c1cafe45d43787f84498)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-06-12 09:30:13 +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
03bda44689 Update for 1.1.11
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-10 22:12:32 +02:00
Michael Niedermayer
8e8dc210cd 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)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-10 21:55:41 +02:00
Michael Niedermayer
3af977d4d6 avfilter/graphdump: Fix pointer to local outside scope
Fixes CID1194435
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 18af0ce62da322176f7bd283b85314d2f41bee2c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-10 21:55:41 +02:00
Michael Niedermayer
cb0d255e2f avcodec/mjpegdec: Fix undefined shift
Fixes CID1194388

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-10 21:55:41 +02:00
Michael Niedermayer
d2ceca6e8b ffmpeg_filter: fix pointer to local outside scope
Fixes CID1206652
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 09b16619d33ddf93005060d0782f28a1c1cbb7f6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-10 21:55:41 +02:00
Michael Niedermayer
e8411c3b6d swresample: fix AV_CH_LAYOUT_STEREO_DOWNMIX input
Fixes Ticket 3542

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-10 21:55:41 +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
714dd84f20 Merge commit '2340ce6954db2c0a79c57fcba7f45e2fcc20cdc9' into release/1.1
* commit '2340ce6954db2c0a79c57fcba7f45e2fcc20cdc9':
  update Changelog

Conflicts:
	Changelog

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 16:21:25 +02:00
Michael Niedermayer
ebd74c42a2 Merge commit '1f5678c5e404ebd326f6eae1b527beadaa85a528' into release/1.1
* commit '1f5678c5e404ebd326f6eae1b527beadaa85a528':
  Update Changelog for v9.13

Conflicts:
	Changelog

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-04 23:46:44 +02:00
Michael Niedermayer
0597f05237 Merge commit '9a2387cfb1a99e4b00593c22074929cdc73410f0' into release/1.1
* commit '9a2387cfb1a99e4b00593c22074929cdc73410f0':
  swscale: Fix an undefined behaviour

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-04 23:46:08 +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
b9be91c03d Merge commit '05de372350f8720461d3cadba40836546f1bb95c' into release/1.1
* commit '05de372350f8720461d3cadba40836546f1bb95c':
  apedec: do not buffer decoded samples over AVPackets

Conflicts:
	libavcodec/apedec.c

See: 77d89a5b160127b5b60ba0310cb999077a22525d
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-04 22:36:26 +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
Michael Niedermayer
707cfea374 Merge commit '42a8d326978f6cf64fdc6deec8a3d91e5e1eaf07' into release/1.1
* commit '42a8d326978f6cf64fdc6deec8a3d91e5e1eaf07':
  movdec: handle 0x7fff langcode as macintosh per the specs

See: e636aa1a56bcd91242c25282dcb00929196470eb
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-04 22:15:41 +02:00
Michael Niedermayer
ebefc92a3d Merge commit '945a1b7ab9b9df317e175e480a135a41e7e05b5c' into release/1.1
* commit '945a1b7ab9b9df317e175e480a135a41e7e05b5c':
  h264: reset next_output_pic earlier in start_frame()

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-04 22:14:45 +02:00
Michael Niedermayer
11b3462aa3 Merge commit 'cf7bb6ceb1da7682aa54989f83d81c67a5e6790d' into release/1.1
* commit 'cf7bb6ceb1da7682aa54989f83d81c67a5e6790d':
  Revert "pthread: flush all threads on flush, not just the first one"

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-04 22:02:08 +02:00
Rafaël Carré
2340ce6954 update Changelog 2014-05-04 10:46:29 -04:00
Reinhard Tartler
1f5678c5e4 Update Changelog for v9.13 2014-05-04 10:37:49 -04:00
Luca Barbato
9a2387cfb1 swscale: Fix an undefined behaviour
Prevent a division by zero down the codepath.

Sample-Id: 00001721-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 3a177a9cca924e097265b32f9282814f6b653e08)
(cherry picked from commit 0499f7809c1fcc33ed710cdf771a18b374702135)
2014-05-04 10:20:48 -04: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
Rafaël Carré
05de372350 apedec: do not buffer decoded samples over AVPackets
Only consume an AVPacket when all the samples have been read.

When the rate of samples output is limited (by the default value
of max_samples), consuming the first packet immediately will cause
timing problems:

- The first packet with PTS 0 will output 4608 samples and be
consumed entirely
- The second packet with PTS 64 will output the remaining samples
(typically, a lot, that's why max_samples exist) until the decoded
samples of the first packet have been exhausted, at which point the
samples of the second packet will be decoded and output when
av_decode_frame is called with the next packet).

That means there's a PTS jump since the first packet is 'decoded'
immediately, which can be seen with avplay or mplayer: the timing
jumps immediately to 6.2s (which is the size of a packet).

Sample: http://streams.videolan.org/issues/6348/Goldwave-MAClib.ape

Bug-Debian: http://bugs.debian.org/744901
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
(cherry picked from commit 91d4cfb8127f1de6c4ad173a30fffe584700046d)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-05-03 12:06:08 -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
Anton Khirnov
945a1b7ab9 h264: reset next_output_pic earlier in start_frame()
In case start_frame() fails, this potentially invalid frame can still be
output to the caller.

Bug-Id: 672
Bug-Id: debian/741240
Bug-Id: ubuntu/1288206
2014-04-24 13:06:02 +02:00
Anton Khirnov
cf7bb6ceb1 Revert "pthread: flush all threads on flush, not just the first one"
This reverts commit 2eb15cdeef29eb8a0a32658154decba94b4b89cb.

It does not work correctly in pre-refcounting threading code.
2014-04-24 07:46:48 +02:00
Michael Niedermayer
5f390ee944 Update for FFmpeg 1.1.10
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-22 01:01:20 +02:00
Michael Niedermayer
b24e68c9c3 avfilter/filtfmts: Support dynamically allocated in/outputs
Fixes crash
Fixes Ticket3468

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-22 00:21:28 +02:00
Michael Niedermayer
353ff5b4eb avfilter/vf_deshake: fix loss of precission with odd resolutions
Fixes part of Ticket3466
Found-by: Andrey_Karpov / PVS-Studio
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 73734282e0e4df92269984ee1671424e39249481)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-22 00:21:28 +02:00
Michael Niedermayer
47c23f9392 avcodec/g723_1: add assert to help static code analyzers
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1457f3fd90e17745791354fbb87899fc4803085a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-22 00:21:28 +02:00
Michael Niedermayer
d51e0dd9b4 avcodec/diracdec: fix undefined behavior with shifts
Fixes part of Ticket3466
Found-by: Andrey_Karpov / PVS-Studio
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b8598f6ce61ccda3f2ff0c730b009fb650e42986)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-22 00:21:28 +02: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
e459c80fdd swscale/swscale: fix srcStride/srcSlice typo
Fixes part of Ticket3466
Found by: Andrey_Karpov / PVS-Studio
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 14fa7fc6a81d5e59e05243cdc92108eab1b138ac)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-22 00:21:28 +02:00
Michael Niedermayer
15f122316e avcodec/x86/idct_sse2_xvid: fix non C99 inline function
Found-by: Matt Oliver <protogonoi@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 46d5625f44185271862337d61cd246fd569c42a4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-22 00:21:28 +02:00
Anthoine Bourgeois
b546b7a029 avcodec/dirac_arith: Fix build with PIC and stack-check options
Fixes Ticket3540

The function dirac_get_arith_bit in libavcodec/dirac_arith.h can't be
built with PIC and check-stack because the asm code needs 6 registers
and PIC and check-stack options take 1 each and x86 is quite limited
in this area.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-22 00:21:28 +02:00
Michael Niedermayer
8f596a4599 swscale/x86/swscale_template: loose hardcoded dstw_offset
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f6759d9ad4a8b71e6f212ca4f1e7da9fa56d3298)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-22 00:21:28 +02:00
Michael Niedermayer
eea1c5daa0 swresample/resample: use av_malloc_array() where appropriate
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5027f39712fdce25b9008e72d52e5abfeefd5fe6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-22 00:21:28 +02:00
Michael Niedermayer
2880de35b5 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-04-22 00:21:28 +02:00
Michael Niedermayer
0143eb9109 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-04-22 00:21:28 +02:00
Michael Niedermayer
93fe53da91 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-04-22 00:21:28 +02:00
Lukasz Marek
88ec8021ce 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-04-22 00:21:28 +02:00
Michael Niedermayer
8130449f32 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-04-22 00:21:28 +02:00
Michael Niedermayer
f741c39752 avcodec/x86/mpegvideoenc_template: fix integer overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-22 00:21:27 +02:00
Michael Niedermayer
af1bf7f277 avcodec/h263dec: Fix use of uninitialized memory from the bitstream buffer
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f07cebcd910c97ff6012085c21493231752990e9)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-22 00:21:27 +02:00
Michael Niedermayer
e770488b50 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-04-22 00:21:27 +02:00
Timothy Gu
6294d84dca 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-04-22 00:21:27 +02:00
Michael Niedermayer
a68d4f55de Merge commit 'ce364088ef53dbaf90e74a471d12b732b697e0cd' into release/1.1
* commit 'ce364088ef53dbaf90e74a471d12b732b697e0cd':
  configure: Support older version of openjpeg1

Conflicts:
	configure

See: 58b8d268d97109b3df0fd77feb7acde3f139c4e1
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 17:24:43 +02:00
Michael Niedermayer
fdcdfb36b7 Merge commit 'ca14a2d0e40720d018421e06995737e5682c33c9' into release/1.1
* commit 'ca14a2d0e40720d018421e06995737e5682c33c9':
  configure: Use the right pkgconf file for openjpeg

Conflicts:
	configure

See: 182c674f68139f5613147fd9e0a7f196dc9c8bea
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 17:23:59 +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
10b8ae5b10 Merge commit 'dccac759d39e761398d3d4172ae0b98c0186efa5' into release/1.1
* commit 'dccac759d39e761398d3d4172ae0b98c0186efa5':
  lavr: allocate the resampling buffer with a positive size

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 17:13:58 +02:00
Michael Niedermayer
63b38d4a91 Merge commit '85b8b169175a55fc862e01ecc96f649374bc14d2' into release/1.1
* commit '85b8b169175a55fc862e01ecc96f649374bc14d2':
  tiffdec: use bytestream2 to simplify overread/overwrite protection

Conflicts:
	libavcodec/tiff.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 17:06:03 +02:00
Michael Niedermayer
260f37ee4d Merge commit 'd946e4c1bcfb6accd97f6d4cbfa324ef01913c8d' into release/1.1
* commit 'd946e4c1bcfb6accd97f6d4cbfa324ef01913c8d':
  bytestream: add bytestream2_copy_buffer() functions

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 16:57:01 +02:00
Michael Niedermayer
da32e3c398 Merge commit '0c5e6c542f5efffb4cd770e84967478b0076a6e5' into release/1.1
* commit '0c5e6c542f5efffb4cd770e84967478b0076a6e5':
  bytestream: add functions for accessing size of buffer

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 16:56:44 +02:00
Michael Niedermayer
6e3830cca2 Merge commit 'd21bf0d27b547adcaabaa28d475e6b9f97dfe20a' into release/1.1
* commit 'd21bf0d27b547adcaabaa28d475e6b9f97dfe20a':
  resample: fix avresample_get_delay() return value

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 16:56:22 +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
cb29eb144b Merge commit 'ee21d270f8dc5fdb2263f5dd87407aae9fe1ecd1' into release/1.1
* commit 'ee21d270f8dc5fdb2263f5dd87407aae9fe1ecd1':
  af_channelmap: fix ONE_STR mapping mode

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 16:42:24 +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
Michael Niedermayer
1552b850db Merge commit 'b1432e905d462198a8d7834b256848f2b9e4f8e6' into release/1.1
* commit 'b1432e905d462198a8d7834b256848f2b9e4f8e6':
  avfilter: Add missing emms_c when needed

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 16:33:51 +02:00
Michael Niedermayer
47e18e2e03 Merge commit '1bccf68caeee787139f22679e1300a5eea048cf5' into release/1.1
* commit '1bccf68caeee787139f22679e1300a5eea048cf5':
  build: Use pkg-config for openjpeg

Conflicts:
	configure

See: 9c99bc1f3fb974f07bc9b565dad00d0e162a09c1
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 16:26:54 +02:00
Michael Niedermayer
0162ad1a59 Merge commit '2eb15cdeef29eb8a0a32658154decba94b4b89cb' into release/1.1
* commit '2eb15cdeef29eb8a0a32658154decba94b4b89cb':
  pthread: flush all threads on flush, not just the first one

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 16:25:24 +02:00
Michael Niedermayer
fa73d13678 Merge commit 'b701e26a4e89e3816490bc74bc47f82e6b7f7002' into release/1.1
* commit 'b701e26a4e89e3816490bc74bc47f82e6b7f7002':
  mpeg12: check scantable indices in all decode_block functions

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 16:18:24 +02:00
Michael Niedermayer
8401ed651b Merge commit 'ea1806ce650f0502dd25939c335b9216fa4a955f' into release/1.1
* commit 'ea1806ce650f0502dd25939c335b9216fa4a955f':
  sgidec: fix buffer size check in expand_rle_row()

Conflicts:
	libavcodec/sgidec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 16:00:51 +02:00
Michael Niedermayer
fcaf78f5f9 Merge commit 'ff409c7d80b6781e4b81dd860badb569061ddaa5' into release/1.1
* commit 'ff409c7d80b6781e4b81dd860badb569061ddaa5':
  adx: check that the offset is not negative

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 15:55:28 +02:00
Michael Niedermayer
8e5a021512 Merge commit 'c9be276f8b040e7d441a77f774afe94b6f137be6' into release/1.1
* commit 'c9be276f8b040e7d441a77f774afe94b6f137be6':
  mpegvideo: set reference/pict_type on generated reference frames

Conflicts:
	libavcodec/mpegvideo.c

See: 532b93b51631ee58443bee8aec7c2a2b2a1746be
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 15:54:30 +02:00
Michael Niedermayer
a23748a804 Merge commit 'd8e89a37267f276afd404bd062e5112a336d1a36' into release/1.1
* commit 'd8e89a37267f276afd404bd062e5112a336d1a36':
  h264: reset data partitioning at the beginning of each decode call

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 15:33:52 +02:00
Michael Niedermayer
6961f9f9f4 Merge commit '7e8d27c8510a024e6d66d2e1116bb8692d9cb98a' into release/1.1
* commit '7e8d27c8510a024e6d66d2e1116bb8692d9cb98a':
  h264: reset ref count if decoding the slice header fails

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 15:29:34 +02:00
Michael Niedermayer
11dfd2a74a Merge commit '7fd6c9fb49573870b48a995947edc83eedd7e86e' into release/1.1
* commit '7fd6c9fb49573870b48a995947edc83eedd7e86e':
  h264: reset first_field if frame_start() fails for missing refs

Conflicts:
	libavcodec/h264.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 15:28:24 +02:00
Michael Niedermayer
f6c1fdba22 Merge commit '175b53d051cf9e17583106c828c35d169f335ea3' into release/1.1
* commit '175b53d051cf9e17583106c828c35d169f335ea3':
  h264: limit allowed pred modes in ff_h264_check_intra_pred_mode() to 3

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 15:18:42 +02:00
Michael Niedermayer
f294748cbc h264: fix size of arrays in ff_h264_check_intra_pred_mode()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d6a33f5d20b6ef2eae2cbb959b001cb125a564b7)

Conflicts:

	libavcodec/h264.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 15:17:43 +02:00
Michael Niedermayer
40e6c148f5 h264/ff_h264_check_intra_pred_mode: fix input value check
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2005fddcbb4e18e8f7c34326e40609e4a2d83c31)

Conflicts:

	libavcodec/h264.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 15:17:04 +02:00
Michael Niedermayer
9081b4dddd Merge commit '7f604a048e9b6128cdf9ce7e95f21d1a9822ba39' into release/1.1
* commit '7f604a048e9b6128cdf9ce7e95f21d1a9822ba39':
  h264: reject mismatching luma/chroma bit depths during sps parsing

Conflicts:
	libavcodec/h264_ps.c

See: bdeb61ccc67911cfc5e20c7cfb1312d0501ca90a
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 15:15:41 +02:00
Michael Niedermayer
58e2d529b3 Merge commit '7e513d85e80d730718695d09fcaf0295ae24699e' into release/1.1
* commit '7e513d85e80d730718695d09fcaf0295ae24699e':
  h264: check that execute_decode_slices() is not called too many times

See: 64591f8f86f2dfeac13ee6b4e971d069675ca814
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 15:02:54 +02:00
Michael Niedermayer
b9550ea116 Merge commit 'b6a0f5cde808d84626f07b11c381cc6ef0954940' into release/1.1
* commit 'b6a0f5cde808d84626f07b11c381cc6ef0954940':
  h264: do not use 422 functions for monochrome

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 15:01:30 +02:00
Michael Niedermayer
58bdec57fa Merge commit '1147d39bca135df8673031d16989ba486a52172a' into release/1.1
* commit '1147d39bca135df8673031d16989ba486a52172a':
  h264: reset data_partitioning if decoding the slice header for NAL_DPA fails

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 15:00:53 +02:00
Michael Niedermayer
7434225ed1 Merge commit '30e58e65e543d04d5e52bf188b31abf4dd41a104' into release/1.1
* commit '30e58e65e543d04d5e52bf188b31abf4dd41a104':
  h264_refs: make sure not to write over the bounds of the default ref list

Conflicts:
	libavcodec/h264_refs.c

See: 0a5ca63c24b8a07f94611637ba29e41b8b47ce24
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 14:39:55 +02:00
Michael Niedermayer
c9f17afe4e Merge commit 'af40847681b978441fdd25276685414f9e17820a' into release/1.1
* commit 'af40847681b978441fdd25276685414f9e17820a':
  h264: check buffer size before accessing it

Conflicts:
	libavcodec/h264.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 14:34:02 +02:00
Michael Niedermayer
6d33c8ec84 Merge commit 'fc53a09909ae046dbe4d339bffc744cfc328253e' into release/1.1
* commit 'fc53a09909ae046dbe4d339bffc744cfc328253e':
  cmdutils: update copyright year to 2014.

Conflicts:
	cmdutils.c

No change as the copyright year has already been fixed

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 14:25:01 +02:00
Michael Niedermayer
238532700e Merge commit '4c1e4bc6af1596995e895cd7da9f3b436051114c' into release/1.1
* commit '4c1e4bc6af1596995e895cd7da9f3b436051114c':
  Prepare for 9.13 Release

Conflicts:
	RELEASE

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 14:24:15 +02:00
Michael Niedermayer
ed9ab30f4c Merge commit 'd791e8c990a752435d993df01516ebe469d94535' into release/1.1
* commit 'd791e8c990a752435d993df01516ebe469d94535':
  doc: Point to the correct, actually maintained gas-preprocessor repo

Conflicts:
	doc/platform.texi

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 14:20:35 +02:00
Michael Niedermayer
1fabe4ae8c Merge commit 'f1a2364cebe472a98a5ea157071f4eee4429ce9f' into release/1.1
* commit 'f1a2364cebe472a98a5ea157071f4eee4429ce9f':
  Update Changelog for 9.12

Conflicts:
	Changelog

Not merged, as the changelog does not apply to FFmpeg like this

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 14:19:46 +02:00
Michael Niedermayer
4ccde2d356 Merge commit 'b00444c0bbbc78ae477ec697d6569893609f420d' into release/1.1
* commit 'b00444c0bbbc78ae477ec697d6569893609f420d':
  configure: Update freetype check to follow upstream

Conflicts:
	configure

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 14:06:52 +02:00
Alexander Strasser
fb487e2f66 configure: Special case libfreetype test
Include the freetype header, in-directly through a macro, like it
is done in the drawtext filter. Do not break if the header is moved.

Unfortunately the drawtext filter included the file where the include
macros are defined in a wrong way. This is not needed and breaks the
build. Remove that #include line too.

Signed-off-by: Alexander Strasser <eclipse7@gmx.net>
(cherry picked from commit cea5812fa723c08b89d929eeba73462e05de2973)

Conflicts:

	configure

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 14:05:30 +02:00
Michael Niedermayer
be9074debc Merge commit '29b3ca743dd02efbe00565c0b997e735e4daa772' into release/1.1
* commit '29b3ca743dd02efbe00565c0b997e735e4daa772':
  drawtext: Drop pointless header

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 14:02:06 +02:00
Michael Niedermayer
fa29e89d41 Merge commit 'a32e45df82751784f9461f01310e63f4bed721dc' into release/1.1
* commit 'a32e45df82751784f9461f01310e63f4bed721dc':
  configure: Support preprocessor macros as header names

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 13:56:06 +02:00
Michael Niedermayer
f6cb3827df Merge commit '7a2254ab26b24255a4d6ea476ba5fd38525a9bb3' into release/1.1
* commit '7a2254ab26b24255a4d6ea476ba5fd38525a9bb3':
  arm: hpeldsp: fix put_pixels8_y2_{,no_rnd_}armv6

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 13:55:37 +02:00
Michael Niedermayer
c40631baf7 Merge commit 'cb95c1935f43ee6ae7fd15439df0f674e809f180' into release/1.1
* commit 'cb95c1935f43ee6ae7fd15439df0f674e809f180':
  qt-faststart: Check offset_count before reading from the moov_atom buffer

Conflicts:
	tools/qt-faststart.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 13:32:22 +02:00
Luca Barbato
ce364088ef configure: Support older version of openjpeg1
It should work best for debian stable and people not installing the .pc
file.
(cherry picked from commit aa807425395caa17a85ed2833133278e8bd44a76)

Conflicts:
	configure

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-04-21 07:33:14 +02:00
Luca Barbato
ca14a2d0e4 configure: Use the right pkgconf file for openjpeg
The current release of version 1 uses libopenjpeg1.
(cherry picked from commit 4a8562394b685e83ae4a38a93eef43625755a231)

Conflicts:
	configure

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-04-21 07:32:09 +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
Anton Khirnov
dccac759d3 lavr: allocate the resampling buffer with a positive size
This fixes cases where very few input samples (fewer than needed for one
output sample) are passed to lavr at the beginning.
CC:libav-stable@libav.org
(cherry picked from commit ac976ed91e323754e9a84509873ebdb437372797)
2014-04-15 23:12:43 -04:00
Justin Ruggles
85b8b16917 tiffdec: use bytestream2 to simplify overread/overwrite protection
Based on a patch by Paul B Mahol <onemda@gmail.com>

CC:libav-stable@libav.org
2014-04-15 00:45:06 -04:00
Justin Ruggles
d946e4c1bc bytestream: add bytestream2_copy_buffer() functions
This is basically an overread/overwrite-safe memcpy between a
GetByteContext and a PutByteContext.

CC:libav-stable@libav.org
(cherry picked from commit 5748faf291fec297ef25d81962b52b3438f54278)
2014-04-14 23:19:18 -04:00
Paul B Mahol
0c5e6c542f bytestream: add functions for accessing size of buffer
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>

CC:libav-stable@libav.org
(cherry picked from commit de9d2705f61ef569487ec5f8974a9c7ce34ec783)
2014-04-14 23:18:53 -04:00
Anton Khirnov
d21bf0d27b resample: fix avresample_get_delay() return value
The correct "next" input sample is not the first sample of the
resampling buffer, but the center sample of the filter_length-sized
block at the beginning.

CC:libav-stable@libav.org
2014-04-14 23:13:23 -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
Anton Khirnov
ee21d270f8 af_channelmap: fix ONE_STR mapping mode
get_channel() returns 0 on success

CC:libav-stable@libav.org
2014-04-14 18:38:20 -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
Luca Barbato
b1432e905d avfilter: Add missing emms_c when needed
Arch specific calls should have an emms_c following to keep the cpu
state consistent.

Reported-By: wm4
CC: libav-stable@libav.org
(cherry picked from commit e995cf1bccc6e91bbaa6a8771e23fb3ab259c110)
2014-04-14 18:29:46 -04:00
Pierre Lejeune
1bccf68cae build: Use pkg-config for openjpeg
Bug-Id: 387
CC: libav-stable@libav.org
2014-04-14 18:26:28 -04:00
Diego Biurrun
2eb15cdeef pthread: 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.

CC:libav-stable@libav.org
Bug-Id: vlc/9665
2014-04-14 18:09:09 -04:00
Janne Grunau
b701e26a4e mpeg12: check scantable indices in all decode_block functions
Add checks to the fast functions used with CODEC_FLAGS2_FAST and move
the check for all other functions to before the invalid memory is
accessed. Fixes https://trac.videolan.org/vlc/ticket/9713 with
CODEC_FLAGS2_FAST.

CC: libav-stable@libav.org
2014-04-14 17:45:19 -04:00
Anton Khirnov
ea1806ce65 sgidec: fix buffer size check in expand_rle_row()
Right now it will spuriously fail if the linesize is exactly equal to
the data width.

CC:libav-stable@libav.org
2014-04-14 16:55:39 -04:00
Anton Khirnov
ff409c7d80 adx: check that the offset is not negative
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
(cherry picked from commit 5569146d48f06564e8fa393424782cceed510916)
2014-04-14 16:55:39 -04:00
Anton Khirnov
c9be276f8b mpegvideo: set reference/pict_type on generated reference frames
Otherwise the generic code will unref them, which can then result in
last_picture_ptr == current_picture_ptr, which causes deadlocks at least
in rv40.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-04-14 16:55:39 -04:00
Anton Khirnov
d8e89a3726 h264: reset data partitioning at the beginning of each decode call
Prevents using GetBitContexts with data from previous calls.

Fixes access to freed memory.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-04-14 16:55:39 -04:00
Anton Khirnov
7e8d27c851 h264: reset ref count if decoding the slice header fails
Otherwise the ER code might try to use some already freed references.

Fixes possible access to freed memory.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-04-14 16:55:39 -04:00
Anton Khirnov
7fd6c9fb49 h264: reset first_field if frame_start() fails for missing refs
In this case we may not have a current frame, while first_field being
set implies we do.

Fixes invalid reads.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-04-14 16:55:38 -04:00
Anton Khirnov
175b53d051 h264: limit allowed pred modes in ff_h264_check_intra_pred_mode() to 3
Higher modes are not allowed for 16x16/chroma, which is what this
function is used for. Otherwise this function would return 0 (vertical
prediction) for invalid higher modes, which could result in invalid
reads.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-04-14 16:55:38 -04:00
Anton Khirnov
7f604a048e h264: reject mismatching luma/chroma bit depths during sps parsing
There is no point in delaying the check and it avoids bugs with a
half-initialized context.

Fixes invalid reads.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-04-14 16:55:38 -04:00
Anton Khirnov
7e513d85e8 h264: check that execute_decode_slices() is not called too many times
Fixes invalid reads.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
(cherry picked from commit 9eef9eb3014b2ed9c3ff4aac510a9f04edb555cf)
2014-04-14 16:55:38 -04:00
Anton Khirnov
b6a0f5cde8 h264: do not use 422 functions for monochrome
Fixes invalid memory access.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-04-14 16:55:38 -04:00
Anton Khirnov
1147d39bca h264: reset data_partitioning if decoding the slice header for NAL_DPA fails
If it was set before then we can end up trying to decode a slice without
a valid slice header, which can lead to invalid memory access.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
(cherry picked from commit 58312b2472d3a44d7458865c459d59ef2e02bf1a)
2014-04-14 16:55:38 -04:00
Anton Khirnov
30e58e65e5 h264_refs: make sure not to write over the bounds of the default ref list
Fixes invalid writes.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-04-14 16:55:38 -04:00
Anton Khirnov
af40847681 h264: check buffer size before accessing it
Fixes invalid reads.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-04-14 16:55:37 -04:00
Johan Andersson
fc53a09909 cmdutils: update copyright year to 2014.
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 7ce88e5ec41484c452da56853a6897803da9c2a5)
2014-04-14 16:55:37 -04:00
Reinhard Tartler
4c1e4bc6af Prepare for 9.13 Release 2014-03-29 13:12:15 -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
Martin Storsjö
d791e8c990 doc: Point to the correct, actually maintained gas-preprocessor repo
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit d15c536123a44362ace6299c391a492c90b83fc7)
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-03-16 20:54:46 +02:00
Reinhard Tartler
f1a2364ceb Update Changelog for 9.12 2014-03-13 20:57:21 -04:00
Luca Barbato
b00444c0bb configure: Update freetype check to follow upstream
The freetype tutorial suggests to use #include FT_FREETYPE_H.

Bug-Id: 616
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

(cherry picked from commit e61b8fa5605b16a02a2a0ea75afbfc31d7832bba)
2014-03-13 12:17:30 +01:00
Luca Barbato
29b3ca743d drawtext: Drop pointless header
It should be forward compatible with newer freetype.

(cherry picked from commit d68dc3c9446e38b4d686cc0f55433c9e8d7c128b)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-03-13 12:16:40 +01:00
Diego Biurrun
a32e45df82 configure: Support preprocessor macros as header names
New versions of FreeType have moved the location of their API
header(s) and hide the location behind a macro.

Since the location changes between versions and no other way
to know the location exists, this workaround becomes necessary.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 52ccc4a0ece88030e67254418317d72089a0ecc8)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-03-13 12:14:14 +01:00
Janne Grunau
7a2254ab26 arm: hpeldsp: fix put_pixels8_y2_{,no_rnd_}armv6
The overread avoidance fix in cbddee1cca0ebd01e8c5aa694d31228eb4de4b41
broke the computation for the last row since it prevented the safe
reading from the height+1-th row.
2014-03-08 19:05:06 +01:00
Michael Niedermayer
cb95c1935f qt-faststart: Check offset_count before reading from the moov_atom buffer
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit bb95334c34d0d9abccea370ae25c4765d7764ab8)
(cherry picked from commit 7754d4838178a5c09c3c3953bb2b90d1abc639e3)
2014-03-07 16:16:10 -05:00
Michael Niedermayer
26e1bccec6 update for 1.1.9
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-07 04:14:03 +01:00
Michael Niedermayer
d891fc9181 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-07 04:04:08 +01:00
Michael Niedermayer
50169747db 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-07 04:04:08 +01:00
Michael Niedermayer
ff5647b253 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-07 04:04:07 +01:00
Michael Niedermayer
0c58c165ab 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-07 04:04:07 +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
b0b02a2101 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-07 04:04:07 +01:00
Michael Niedermayer
51231fa6f6 avdevice/v4l2: only use average frame rate if set
It might be unset on some platforms with some drivers and some input

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

Conflicts:

	libavdevice/v4l2.c
2014-03-07 04:04:07 +01:00
Michael Niedermayer
c6a4083c29 avdevice/v4l2: only use frame period from v4l2 if valid
There is evidence that some drivers do not set a valid value

See: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=718805
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4aa4533ee8b51a1e6bdc4fbffaf90aa2b14e2c9f)

Conflicts:

	libavdevice/v4l2.c
2014-03-07 04:04:07 +01:00
Michael Niedermayer
1997487f67 avutil/log: skip IO calls on empty strings
These occur when no context is set for example, thus they are common

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-07 04:04:07 +01:00
Paul B Mahol
aeccfca268 avcodec/libopusenc: change default frame duration to 20 ms
20 ms is used by libopus encoder.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit 74906d3727ec3bd9b7b28dfa7a98ff6e8cf8b6d7)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-07 04:04:07 +01:00
Michael Niedermayer
15d96c605b avcodec/jpeglsdec: check err value for ls_get_code_runterm()
Fixes infinite loop
Fixes Ticket3086

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-07 04:04:07 +01:00
Michael Niedermayer
67c3e3de55 avutil/opt: initialize ret
Fixes CID1108610
Fixes use of uninitialized variable

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-07 04:04:07 +01:00
Michael Niedermayer
8b0880ff1b avcodec/avpacket/av_packet_split_side_data: ensure that side data padding is initialized
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 240fd8c96f59ebe9dcfc4152a1086cd3f63400c0)

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-07 04:04:07 +01:00
Michael Niedermayer
f1f06710c4 Merge remote-tracking branch 'qatar/release/9' into release/1.1
* qatar/release/9:
  arm: hpeldsp: prevent overreads in armv6 asm

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-07 03:59:18 +01:00
Michael Niedermayer
993c2a256d Merge commit '798c715f4fa5cde37456af6202a32ee62cfb96d9' into release/1.1
* commit '798c715f4fa5cde37456af6202a32ee62cfb96d9':
  configure: enable PIC on s390(x)
  ituh263: reject b-frame with pp_time = 0
  lagarith: reallocate rgb_planes when needed
  truemotion1: check the header size
  shorten: pad the internal bitstream buffer
  samplefmt: avoid integer overflow in av_samples_get_buffer_size()

Conflicts:
	libavcodec/lagarith.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-07 03:54:51 +01:00
Michael Niedermayer
c9fef27deb Merge commit '8883b5f85bfe35509633bc590d19b6a1b495690e' into release/1.1
* commit '8883b5f85bfe35509633bc590d19b6a1b495690e':
  h264: Fix a typo from the previous commit
  h264: Lower bound check for slice offsets
  Add missing header to fix compilation after d2a0654
  Prepare for 9.12 RELEASE
  configure: Add missing dependency of Snow decoder on videodsp
  rpza: limit the number of blocks to the total remaining blocks in the frame

Conflicts:
	RELEASE

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-07 03:10:13 +01:00
Janne Grunau
460b948283 arm: hpeldsp: prevent overreads in armv6 asm
Based on a patch by Russel King <rmk+libav@arm.linux.org.uk>

Bug-Id: 646
CC: libav-stable@libav.org
2014-03-05 19:45:00 +01:00
Reinhard Tartler
798c715f4f configure: enable PIC on s390(x)
The s390 architecture requires shared libraries to be built in PIC mode.
Otherwise applications will get wrong relocations at run-time, leading
to confusing segmentation faults.

CC: libav-stable@libav.org
(cherry picked from commit 5ddc9f5052316608799b932c604f9e7561f8ce24)
(cherry picked from commit 7509c2c4ea2180733cc60ab1a0e0fe4ce2f02a69)
2014-03-04 21:43:10 -05:00
Keiji Costantini
aa2a3ca27a ituh263: reject b-frame with pp_time = 0
Avoid a division by 0 in ff_mpeg4_set_one_direct_mv.

Sample-Id: 00000168-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
(cherry picked from commit 9514440337875e0c63b409abcd616b68c518283f)
(cherry picked from commit 5df52b0131d3d4d804ad6e221bc9a2cd8b201ef2)
2014-03-02 11:45:32 -05:00
Luca Barbato
8883b5f85b h264: Fix a typo from the previous commit
f777504f640260337974848c7d5d7a3f064bbb45 changed a - in +

CC: libav-stable@libav.org
(cherry picked from commit d922c5a5fbaf0b6c73bd8c81ae059bc6e406961c)
(cherry picked from commit 3ce77e04c2ca4b9e7fa6b94b51e8d7c5f188da86)
2014-02-28 23:05:53 -05:00
Anton Khirnov
b4d72f901c lagarith: reallocate rgb_planes when needed
Fixes invalid writes on pixel format changes.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
(cherry picked from commit 4c3e1956ee35fdcc5ffdb28782050164b4623c0b)
2014-02-28 23:05:53 -05:00
Vittorio Giovara
7c70cee29c h264: Lower bound check for slice offsets
And use the value from the specification.

Sample-Id: 00000451-google
Found-by: Mateusz j00ru Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org

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

Conflicts:
	libavcodec/h264.c
2014-02-28 23:05:53 -05:00
Anton Khirnov
13fd80837f truemotion1: check the header size
Fixes invalid reads.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
(cherry picked from commit 2240e2078d53d3cfce8ff1dda64e58fa72038602)
2014-02-28 23:05:53 -05:00
Anton Khirnov
f1a7bfea41 shorten: pad the internal bitstream buffer
Fixes invalid reads.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
(cherry picked from commit 1713eec29add37b654ec6bf262b843d139c1ffc6)
2014-02-28 23:05:53 -05:00
Justin Ruggles
3e3805b7fa samplefmt: avoid integer overflow in av_samples_get_buffer_size()
CC:libav-stable@libav.org
(cherry picked from commit 0e830094ad0dc251613a0aa3234d9c5c397e02e6)
2014-02-28 23:05:53 -05:00
Anton Khirnov
8ba514117b Add missing header to fix compilation after d2a0654
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-02-28 23:05:08 -05:00
Reinhard Tartler
675cf1cded Prepare for 9.12 RELEASE 2014-02-28 22:39:04 -05:00
Diego Biurrun
0c1a15db46 configure: Add missing dependency of Snow decoder on videodsp 2014-02-21 10:31:39 +01:00
Anton Khirnov
d2a065437a rpza: limit the number of blocks to the total remaining blocks in the frame
Fixes invalid writes.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
(cherry picked from commit 77bb0004bbe18f1498cfecdc68db5f10808b6599)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-02-14 11:31:35 +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
fd856693de Merge commit 'f1476459b7013d306eb911573f1dc81e74ccd082' into release/1.1
* commit 'f1476459b7013d306eb911573f1dc81e74ccd082':
  vmnc: K&R formatting cosmetics
  flashsv: Check diff_start diff_height values
  dsputil/pngdsp: fix signed/unsigned type in end comparison

Conflicts:
	libavcodec/dsputil.c
	libavcodec/flashsv.c
	libavcodec/vmnc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-04 05:43:42 +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
Michael Niedermayer
af74599e66 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-02-04 04:50:17 +01:00
Michael Niedermayer
74821341b9 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-02-04 04:50:17 +01:00
Michael Niedermayer
7adf4a92a1 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-02-04 04:50:17 +01:00
Michael Niedermayer
e04f68f7c5 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-02-04 04:50:17 +01:00
Michael Niedermayer
10238ada6d cmdutils: update year
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-04 04:50:17 +01:00
Reinhard Tartler
27f60e2b0b Update Changelog for 9.11 2014-02-02 13:08:08 -05:00
Anton Khirnov
62ed6da016 h264: check that an IDR NAL only contains I slices
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
(cherry picked from commit 8b2e5e42bb9d6a59ede5af2e6df4aaf7750d1195)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-02-01 23:51:46 -05: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
Anton Khirnov
03bfd8419f mathematics: remove asserts from av_rescale_rnd()
It is a public function, it must not assert on its parameters.

(cherry picked from commit 94a417acc05cc5151b473abc0bf51fad26f8c5a0)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-02-01 23:51:46 -05:00
Michael Niedermayer
3cc8d9bc1f vc1: Always reset numref when parsing a new frame header.
Fixes an issue where the B-frame coding mode switches from interlaced
fields to interlaced frames, causing incorrect decisions in the motion
compensation code and resulting in visual artifacts.

CC: libav-stable@libav.org
Signed-off-by: Tim Walker <tdskywalker@gmail.com>
(cherry picked from commit dd2d0039b6405dc724e4fef0d5b8f49530eea3aa)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-02-01 23:51:46 -05:00
Anton Khirnov
299c5dcfb0 h264: reset num_reorder_frames if it is invalid
An invalid VUI is not considered a fatal error, so the SPS containing it
may still be used. Leaving an invalid value of num_reorder_frames there
can result in writing over the bounds of H264Context.delayed_pic.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
(cherry picked from commit 9ecabd7892ff073ae60ded3fc0a1290f5914ed5c)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>

Conflicts:
	libavcodec/h264_ps.c
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
c85e5f13f6 cavs: Check for negative cbp
Sample-Id: 00000647-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2014-02-01 14:59:50 -05:00
Luca Barbato
f1476459b7 vmnc: K&R formatting cosmetics
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-02-01 14:59:50 -05:00
Anton Khirnov
b5275ca1a8 h264_cavlc: check the size of the intra PCM data.
Fixes invalid reads.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-02-01 14:59:50 -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
Michael Niedermayer
d9c82cea11 h263: Check init_get_bits return value
And use init_get_bits8 to check for integer overflows while at it.

CC: libav-stable@libav.org
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-02-01 14:59:50 -05:00
Luca Barbato
4b24eb1a03 vmnc: Check the cursor dimensions
And manage the reallocation failure path.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 5e992a4682d2c09eed3839c6cacf70db3b65c2f4)
2014-02-01 14:59:50 -05:00
Anton Khirnov
969028870c cavsdec: check ff_get_buffer() return value
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-02-01 14:59:50 -05:00
Luca Barbato
9f9e773881 vmnc: Port to bytestream2
Fix some buffer overreads.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2014-02-01 14:59:50 -05:00
Michael Niedermayer
10d48fe6d3 flashsv: Check diff_start diff_height values
Fix out of array accesses.

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

Adresses: CVE-2013-7015
(cherry picked from commit 57070b1468edc6ac8cb3696c817f3c943975d4c1)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-02-01 13:56:58 -05:00
Michael Niedermayer
af9799790d dsputil/pngdsp: fix signed/unsigned type in end comparison
Fixes out of array accesses and integer overflows.

(cherry picked from commit d1916d13e28b87f4b1b214231149e12e1d536b4b)
Adresses: CVE-2013-7010, CVE-2013-7014

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-02-01 13:53:41 -05:00
Michael Niedermayer
6fa9741357 avcodec/aacdec: Dont fail if channels arent known yet
Fixes Ticket3312

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

Conflicts:
	libavcodec/aacdec.c
2014-01-19 14:58:22 +01:00
Michael Niedermayer
bb26a88193 avcodec/mjpegdec: Dont treat the lack of a startcode differently from end of the bitstream
Fixes Ticket3303

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 31e703e899bee74c50efd8eb62c3d012ef5ab26d)
2014-01-19 14:57:56 +01:00
Michael Niedermayer
55a4228ac2 avcodec/mjpegdec: only run EOI emulation code when there was a scan
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 361e27a3d8096baacc45d2551a1ebfcbfdaa6a67)
2014-01-19 14:56:18 +01:00
Michael Niedermayer
3ae81880e1 avcodec/mjpegdec: update cur_scan also for non-LS jpeg
This should make no difference but the variable will be used in a subsequent commit

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

Conflicts:
	libavcodec/mjpegdec.c
2014-01-19 14:56:08 +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
1017b5914c update for 1.1.8
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-13 15:20:18 +01:00
Michael Niedermayer
9f47f95e70 Merge remote-tracking branch 'qatar/release/9' into release/1.1
* qatar/release/9:
  prores: Error out only on surely incomplete ac_coeffs

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-13 15:14:13 +01:00
Luca Barbato
9aa22918c2 prores: Error out only on surely incomplete ac_coeffs
(cherry picked from commit 2df7f7714a12a59d31058aba15fb1e348e36b0ab)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-01-13 14:18:37 +01:00
Michael Niedermayer
9b89824f20 Merge remote-tracking branch 'qatar/release/9' into release/1.1
* qatar/release/9:
  shorten: Fix out-of-array read

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-12 17:06:54 +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
1203e92181 Merge commit '0358a099f8abe60230dc2e5bec59bfceb7d1be07' into release/1.1
* commit '0358a099f8abe60230dc2e5bec59bfceb7d1be07':
  indeo4: Check the block size if reusing the band configuration
  ffv1: Assume bitdepth 0 means 8bit
  alsa-audio-dec: explicitly cast the delay to a signed int64
  matroskadec: pad EBML_BIN data.
  motionpixels: clip VLC codes.
  avidec: fix a memleak in the dv init code.

Conflicts:
	libavcodec/ffv1dec.c
	libavcodec/indeo4.c
	libavdevice/alsa-audio-dec.c
	libavformat/matroskadec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-12 16:37:42 +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
Michael Niedermayer
5ea2a8d43e avcodec/msvideo1enc: fix SKIPS_MAX
Fixes Ticket3270

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit fb8f5d0510619cea2204246631f1c0dcd994ee25)
2014-01-09 11:52:48 +01:00
Carl Eugen Hoyos
3ada932202 Use the h264 parser when decoding VSSH in avi.
Fixes ticket #3261 visually.

Analyzed-by: Michael Doilnitsyn
(cherry picked from commit 94cf4f8bac12c58e30ce3b5d72cf5898baafe9a8)

Conflicts:
	libavformat/avidec.c
2014-01-09 11:52:19 +01:00
Michael Niedermayer
adb784ad86 avformat/mxfdec: detect loops during header parsing
The header parser uses forward and backward parsing, making the
bulletproof prevention of loops difficult, thus this simple
detection code.
If someone improves the forward/backward parsing so it cannot loop
then this commit should be reverted

Fixes Ticket3278

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1c010fd035c1a14dc73827b84f21f593e969a5d6)
2014-01-09 11:51:32 +01:00
Michael Niedermayer
4de4eb60a1 avformat/oggdec: dont read timestamps from EOS pages of ogm videos
Some muxers store invalid timestamps there, which breaks seeking
Fixes Ticket2739

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5e0c7eab2a9d43e6e3be967ec1a6b04a3e0328da)
2014-01-09 11:50:29 +01:00
Tim Walker
a0866c7129 shorten: Fix out-of-array read
pred_order == FF_ARRAY_ELEMS(fixed_coeffs) is invalid too.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 5f5ada3dbf97e306a74250ba8dcf8619ad59b020)
Signed-off-by: Tim Walker <tdskywalker@gmail.com>
2014-01-06 16:36:56 +01:00
Luca Barbato
65830277d2 prores: Add a codepath for decoding errors
(cherry picked from commit 44690dfa683f620c77e9f0e8e9bc5682608636b1)
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2014-01-06 02:31:17 +00:00
Derek Buitenhuis
5ae7ed3aa4 nut: Fix unchecked allocations
CC: libav-stable@libav.org

(cherry picked from commit b1fcdc08ceb5df69fac34aa0d57c56905d32b8b4)
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2014-01-06 02:31:05 +00:00
Luca Barbato
61057f4604 avi: directly resync on DV in AVI read failure
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit ceec6e792e4b5baaa23b220f4fd33417631f5288)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:34:06 -05:00
Martin Storsjö
d149c14a22 mov: Don't allocate arrays with av_malloc that will be realloced
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit b698542ad83284fbb8c22404e3cafeb2dd739d38)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:31:06 -05:00
Luca Barbato
5bbee02ae0 shorten: Extend fixed_coeffs to properly support pred_order 0
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit b2148faca9e9e553c14b27844b56e367c85a777e)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:30:53 -05:00
Reinhard Tartler
f53a5332b0 Prepare for 9.11 RELEASE 2014-01-05 17:23:12 -05:00
Luca Barbato
e361fde8b0 avi: properly fail if the dv demuxer is missing
CC: libav-stable@libav.org
(cherry picked from commit 1cac9accbd1f9b8596122d0735e37b97a844c514)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:21:47 -05:00
Luca Barbato
1d7a453dcf prores: Reject negative run and level values
Sample-Id: 00000611-google

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit c0de9a23c7080e2fac8f879b9d9a0ce2b64ea953)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:21:35 -05:00
Anton Khirnov
481e55eba7 audio_mix: fix channel order in mix_1_to_2_fltp_flt_c
CC:libav-stable@libav.org
(cherry picked from commit df6737a55f5dc7c0ae5272bc5fa6182836d5481c)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:21:24 -05:00
Luca Barbato
03457cabd6 indeo4: Check the inherited quant_mat
Invalidate it if not supported.

Sample-Id: 00000262-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit c9ef6b09326a24010bf86d6b0d19cfa42df4d546)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>

Conflicts:
	libavcodec/indeo4.c
2014-01-05 17:21:07 -05:00
Luca Barbato
0358a099f8 indeo4: Check the block size if reusing the band configuration
Sample-Id: 00000287-google

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 0cb83c563848bf8f8365e7bd30e7e6b57ef360f0)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:16:42 -05:00
Luca Barbato
2656036757 ffv1: Assume bitdepth 0 means 8bit
CC: libav-stable@libav.org
Reported-by: debian/726189
(cherry picked from commit a90905db2e6ab1840890f3a88bfd3bf008b9d886)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:15:41 -05:00
Anton Khirnov
f9f2591beb alsa-audio-dec: explicitly cast the delay to a signed int64
Otherwise the expression will be evaluated as unsigned, which will break
when the result should be negative.
CC:libav-stable@libav.org

(cherry picked from commit 089fac77a6bf9199a5ec161e9c27850f0a680541)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:15:04 -05:00
Anton Khirnov
cbf51c4d36 matroskadec: pad EBML_BIN data.
It might be passed to code requiring padding, such as lzo decompression.

Fixes invalid reads.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org

(cherry picked from commit 30be1ea33e5525266ad871bed60b1893a53caeaf)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:13:19 -05:00
Anton Khirnov
26221a54ec motionpixels: clip VLC codes.
Fixes invalid reads.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org

(cherry picked from commit ca41c72c6d9515d9045bd3b68104525dee81b8d0)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:13:08 -05:00
Anton Khirnov
7c214e313c avidec: fix a memleak in the dv init code.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
(cherry picked from commit ce9bba5340a5fb6f38974a19af019dd6aa2da035)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:12:52 -05:00
Anton Khirnov
7b337b1229 truemotion1: make sure index does not go out of bounds
Fixes invalid reads.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org

(cherry picked from commit c918e08b9cc9ce8d06159c51da55ec5ab018039a)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:12:39 -05:00
Anton Khirnov
51ff11647f pcx: round up in bits->bytes conversion in a buffer size check
Fixes invalid reads.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org

(cherry picked from commit 430d12196432ded13f011a3bf7690f03c9b2e5d6)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:12:31 -05:00
Michael Niedermayer
35f9a0896e omadec: Fix wrong number of array elements
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: David Goldwich <david.goldwich@gmail.com>
CC:libav-stable@libav.org
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 97f50e92b5cf3b47a76f75d76ed4340e822030db)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:12:19 -05:00
Michael Niedermayer
cdc47c4813 omadec: check GEOB sizes against buffer size
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: David Goldwich <david.goldwich@gmail.com>
CC:libav-stable@libav.org
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 1c736bedd9891501960ebac0f7c05eb60225e947)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:12:06 -05:00
Michael Niedermayer
e776a1e8f3 ac3dec: fix outptr increment.
Fixes corrupt data errors when downmixing in the AC-3 decoder.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>

CC:libav-stable@libav.org
(cherry picked from commit 6c82c87dbbc0582658968eae46cfebeea90a9c5e)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:11:54 -05:00
Luca Barbato
d6d2617d07 avio: Use AVERROR_PROTOCOL_NOT_FOUND
When the protocol is missing ffurl_alloc() should return
AVERROR_PROTOCOL_NOT_FOUND instead of AVERROR(ENOENT).

Bug-Id: 577
CC: libav-stable@libav.org
(cherry picked from commit ea71aafd6881d7ce5cffec56feb45488e3ac5221)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:08:19 -05:00
Luca Barbato
0e8ae6d10c mpegvideo: Drop a faulty assert
That check is easily reachable by faulty input.

CC:libav-stable@libav.org
Reported-by: Torsten Sadowski <tsadowski@gmx.net>
(cherry picked from commit 72072bf9de3241848ea86f68d2297b7a5d6ad49b)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:08:03 -05:00
Justin Ruggles
24a8dfd37b lavr: check that current_buffer is not NULL before using it
Fixes a segfault during resampling when compiled with -DDEBUG.
Fixes all fate-lavr-resample tests with -DDEBUG.

CC:libav-stable@libav.org
(cherry picked from commit 211ca69b13eb0a127a9ef7e70ddaccdab125d1c5)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:07:46 -05:00
Anton Khirnov
a8f6d93071 pmpdec: check that there is at least one audio packet.
The code cannot handle there being none, but that should not happen for
valid files.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
(cherry picked from commit 1b5d065ca722eb8028c7a08e054b6da3419faf5d)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:01:18 -05:00
Anton Khirnov
ffa83bcc49 lzw: switch to bytestream2
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
(cherry picked from commit e89aa4bf56e5b5c45f569eb12733519789e057da)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:01:03 -05:00
Anton Khirnov
819541ff83 gifdec: convert to bytestream2
(cherry picked from commit 1f3e56b6dcc163a705704e98569d4850a31d651c)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:00:51 -05:00
Anton Khirnov
c5c7e3e6f7 gifdec: check that the image dimensions are non-zero
Also add an error message an return a more suitable error code
(INVALIDDATA, not EINVAL);
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org

(cherry picked from commit c453723ad7d14abc5e82677eebaa6025fa598f08)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 17:00:40 -05:00
Anton Khirnov
5e7a5dd70b gifdec: return meaningful error codes.
(cherry picked from commit 048ffb9bb26f30f1995400b8cd3809221ba03441)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 16:59:55 -05:00
Anton Khirnov
f194f2be41 eacmv: check the framerate before setting it.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
(cherry picked from commit 24057c83207d6ea8bfd824155ac37be8a33dfd0c)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>

Conflicts:
	libavcodec/eacmv.c
2014-01-05 16:57:17 -05:00
Anton Khirnov
343c87ac19 rv30: fix extradata size check.
It has been checking the number of bits in the offset instead of the
actual offset.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
(cherry picked from commit a6a2282c25abe43e352010a7c3fbc92994c0bc1c)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 16:52:11 -05:00
Martin Storsjö
12479588d7 sdp: Check that fmt->oformat is non-null before accessing it
This avoids crashes when avserver tries to create an SDP, since
d77f4af.

Addresses: CVE-2012-6617

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 82b9799bb211ecd117171115e4a8b832c4942314)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 16:49:49 -05:00
Aurelien Jacobs
3e089e8f71 matroskadec: use correct compression parameters for current track CodecPrivate
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 8b516f154a0a08655cec2d13d12aadc58cae0b1c)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 16:49:15 -05:00
Kostya Shishkov
5dcc179924 vc1: Reset numref if fieldmode is not set
There are samples in the wild with B-frames and P-frames with different
interlace mode.

CC: libav-stable@libav.org
Reported-by: Jean-Baptiste Kempf <jb@videolan.org>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit de44dfc7c0ec02bda7d846ef713145c890bfae3f)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-01-05 16:48:34 -05:00
Michael Niedermayer
848af79dec nutenc/write_index: warn if 2 consecutive keyframes have the same PTS and discard the 2nd
This fixes an assertion failure and regression and restores previous behaviour
Fixes Ticket3197

An alternative would be to fail hard in this case and refuse to mux such data.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit de2a2caf4dedb28a959d0ff6f02751bb6c3ff033)
2013-12-24 08:09:53 +01:00
Michael Niedermayer
50ff83e3af Merge remote-tracking branch 'qatar/release/9' into release/1.1
* qatar/release/9:
  arm: Don't clobber callee saved registers in scalarproduct
  alsdec: check block length
  h264/mpegvideo: do not provide pixel formats for hwaccels that are not compiled in
  mpeg4video_parser: init mpeg4 static tables.

Conflicts:
	libavcodec/mpeg4video_parser.c
	libavcodec/mpeg4videodec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-21 02:43:44 +01:00
Michael Niedermayer
2d7f139155 Merge commit '56eded8bc7bccdf14245bae3a45b0fecf9d9d122' into release/1.1
* commit '56eded8bc7bccdf14245bae3a45b0fecf9d9d122':
  mpeg4videodec: split initializing static tables into a separate function
  x86: ac3dsp: Remove 3dnow version of ff_ac3_extract_exponents
  pthread: Avoid spurious wakeups

Conflicts:
	libavcodec/mpeg4videodec.c
	tests/fate/ac3.mak

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-21 02:31:41 +01:00
Michael Niedermayer
b589b8a704 Merge commit '1a5a6ac01b0ad2cf3d2128372ea41f3c1cfc2d3f' into release/1.1
* commit '1a5a6ac01b0ad2cf3d2128372ea41f3c1cfc2d3f':
  pthread: Fix deadlock during thread initialization

Conflicts:
	libavcodec/pthread.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-21 02:14:24 +01:00
Michael Niedermayer
5bd291e265 avfilter/ff_insert_pad: fix order of operations
Fixes out of bounds access
Fixes CID732170
Fixes CID732169

No filter is known to use this function in a way so the issue can be reproduced.

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

Conflicts:

	libavfilter/avfilter.c
(cherry picked from commit 86591b244f3a27293153896813f5569b49b2f5c0)

Conflicts:

	libavfilter/avfilter.c
(cherry picked from commit 400c4f8fa3fd58951dc3f356b2b00484e3363694)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-21 01:45:20 +01:00
Martin Storsjö
bdb975ab69 arm: Don't clobber callee saved registers in scalarproduct
q4-q7/d8-d15 are supposed to not be clobbered by the callee.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit d307e408d4a9ada22df443cc38be77cc5e492694)

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-12-20 21:26:12 +02:00
Reinhard Tartler
3f7d89034b alsdec: check block length
Fix writing over the end

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Addresses: CVE-2013-0845
(cherry picked from commit 2a0fb7286d67c47e44aa76c237ede117b22af616)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-12-14 12:51:40 -05:00
Michael Niedermayer
b8eaf47917 avcodec/cabac: force get_cabac to be not inlined
works around bug in gccs inline asm register assignment
Fixes Ticket3177

gcc from 4.4 to 4.6 is affected at least, no non affected gccs known
clang seems not affected

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0538b29ae8002c44f27bae8a1a6fc6e646998be5)
2013-12-09 10:37:41 +01:00
Anton Khirnov
718a2ddcb8 h264/mpegvideo: do not provide pixel formats for hwaccels that are not compiled in 2013-11-29 20:09:44 +01:00
Anton Khirnov
bd405475ce mpeg4video_parser: init mpeg4 static tables.
They are used when decoding the frame header.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-11-27 09:51:42 +01:00
Anton Khirnov
56eded8bc7 mpeg4videodec: split initializing static tables into a separate function
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-11-27 09:47:01 +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
Clément Bœsch
7f174cec8b build: avoid stdin stall with GNU AS probing.
a758c5e added probing for various tools, such as AS. Unfortunately, GNU
AS is reading stdin with -v, and thus configure is stalled with
configure arguments such as --as=as.

Fixes Ticket #1898.
(cherry picked from commit dbb41f93c16cbc65a899a75723c95da51c851cd5)
2013-11-18 15:15:23 +01:00
Diego Biurrun
a3f8c6a427 x86: ac3dsp: Remove 3dnow version of ff_ac3_extract_exponents
The function requires increasing the fuzz factor for the ac3/eac3 encode
tests and even so makes fate fail. It only provides a slight encoding
speedup for legacy CPUs that do not support SSE2. Thus its benefit is not
worth the trouble it creates and fixing it would be a waste of time.
2013-10-31 12:09:55 +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
6960372475 h264: make flush_change() set mmco_reset
This ensures that frames do not get mixed on context reinits

Fixes Ticket2836

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3c9dd93faa9f3c250428dd0548c075583aa07cc3)
2013-10-26 02:43:50 +02:00
Michael Niedermayer
5bce35d958 avcodec/h264: reduce noisiness of "mmco: unref short failure"
Do not consider it an error if we have no frames and should discard one.
This condition can easily happen when decoding is started from an I frame

Fixes Ticket2811

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

Conflicts:
	libavcodec/h264_refs.c
2013-10-26 01:19:03 +02:00
Michael Niedermayer
8e72a8d1c2 avformat/mp3dec: perform seek resync in the correct direction
Fixes seeking to the last frame in CBR files
Fixes Ticket2773

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ba8716df7fb541fb690d1a898cda0e12f9011faf)
2013-10-26 01:15:06 +02:00
Michael Niedermayer
a4b705b4cb avcodec/h264: do not trust last_pic_droppable when marking pictures as done
This simplifies the code and fixes a deadlock

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

Conflicts:
	libavcodec/h264.c
2013-10-26 01:15:00 +02:00
Michael Niedermayer
802c4f5231 avformat/mov: force parsing of headers if stts is absent
Fixes Ticket2991

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e41ea866fc26f38d770bbc1ad67703e7f4400ae1)
2013-10-24 11:23:59 +02:00
Michael Niedermayer
6636dd551f avcodec/h264_refs: modify key frame detection heuristic to detect more cases
Fixes Ticket2968

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

Conflicts:
	libavcodec/h264_refs.c
2013-10-24 11:22:24 +02:00
Michael Niedermayer
8ffdcd04c4 avformat/matroskadec: only set r_frame_rate if the value is within reasonable limits
Fixes Ticket2451

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6853e40106cac769f0641183ea0bdd530ae9a0a1)
2013-10-24 11:14:37 +02:00
Michael Niedermayer
de32de679b avformat/wavdec: Dont trust the fact chunk for PCM
Fixes Ticket3033

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

Conflicts:
	libavformat/wavdec.c
2013-10-24 11:13:59 +02:00
Ben Jackson
311583e779 pthread: Avoid spurious wakeups
pthread_wait_cond can wake up unexpectedly (Wikipedia: Spurious_wakeup).

The FF_THREAD_SLICE thread mechanism could spontaneously execute
jobs or allow the caller of avctx->execute to return before all
jobs were complete.

Test both cases to ensure the wakeup is real.

Signed-off-by: Ben Jackson <ben@ben.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-21 12:25:26 -04:00
Derek Buitenhuis
1a5a6ac01b pthread: Fix deadlock during thread initialization
Sometimes, if pthread_create() failed, then pthread_cond_wait() could
accidentally be called in the worker threads after the uninit function
had already called pthread_cond_broadcast(), leading to a deadlock.

Don't call pthread_cond_wait() if c->done is set.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2013-10-21 12:25:16 -04:00
Michael Niedermayer
4bc7c1ba8e update for 1.1.7
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-11 15:39:23 +02:00
Michael Niedermayer
0efb4ff86c avcodec/parser: reset indexes on realloc failure
Fixes Ticket2982

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-11 15:36:12 +02:00
Michael Niedermayer
f0bb0aaaa7 avcodec/ffv1enc: update buffer check for 16bps
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3728603f1854b5c79d1a64dd3b41b80640ef1e7f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-11 15:36:12 +02:00
Michael Niedermayer
eb3330b050 Merge remote-tracking branch 'TimothyGu/release/1.1' into release/1.1
* TimothyGu/release/1.1:
  doc/encoders: add doc for AAC encoder
  doc/ffmpeg-formats: Add documentation for 2 parameters that have been missing
  doc/encoders: improve libvo-aacenc doc
  doc/encoders: Remove options that were not there when branch was cut from master
  doc/encoders: reformat and add some clarification in libtwolame doc
  doc/encoders: reformat libmp3lame doc

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-11 15:28:11 +02:00
Michael Niedermayer
e31e66948d Delete changelog
The merges have filled the changelog of the 1.1 branch with bugfix
entries that ffmpeg 1.1 was never affected by or that where fixed
long ago.
No one has cleaned this mess up and its better to have no changelog file
than one that is 80% wrong.
If someone wants to clean this up, thats of course very welcome, aka yes
patches and pull requests welcome!

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-11 14:49:50 +02:00
Michael Niedermayer
835bc39b26 Merge remote-tracking branch 'qatar/release/9' into release/1.1
* qatar/release/9:
  Fix top-level description
  update Changelog

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-11 14:49:28 +02:00
Reinhard Tartler
bb81b2b2e0 Fix top-level description 2013-10-10 09:56:40 -04:00
Reinhard Tartler
58287d3b10 update Changelog 2013-10-10 08:50:09 -04:00
Michael Niedermayer
2a7bdbf67e ffserver: strip odd chars from html error messages before sending them back
Fixes Ticket3034

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-09 00:55:38 +02:00
Michael Niedermayer
653cdf42ee Merge remote-tracking branch 'qatar/release/9' into release/1.1
* qatar/release/9:
  Prepare for 9.10 RELEASE
  h263dec: Remove a hack that can cause infinite loops
  mpegvideo: Initialize chroma_*_shift and codec_tag even if the size is 0
  vc1dec: Don't decode slices when the latest slice header failed to decode

Conflicts:
	RELEASE
	libavcodec/h263dec.c
	libavcodec/mpegvideo.c
	libavcodec/vc1dec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-08 02:11:31 +02:00
Michael Niedermayer
829e43017f Merge commit '494f2d4f9e834db1eaf1a7d0160d497f9802013d' into release/1.1
* commit '494f2d4f9e834db1eaf1a7d0160d497f9802013d':
  vc1dec: Make sure last_picture is initialized in vc1_decode_skip_blocks
  r3d: Add more input value validation
  fraps: Make the input buffer size checks more strict
  svq3: Avoid a division by zero
  rmdec: Validate the fps value
  twinvqdec: Check the ibps parameter separately
  asfdec: Check the return value of asf_read_stream_properties
  mxfdec: set audio timebase to 1/samplerate

Conflicts:
	libavcodec/fraps.c
	libavcodec/svq3.c
	libavformat/mxfdec.c
	tests/ref/fate/mxf-demux
	tests/ref/seek/lavf-mxf
	tests/ref/seek/lavf-mxf_d10

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-08 02:03:40 +02:00
Michael Niedermayer
8d14e1d64e Merge commit '7e350b7ddd19af856b55634233d609e29baab646' into release/1.1
* commit '7e350b7ddd19af856b55634233d609e29baab646':
  pcx: Check the packet size before assuming it fits a palette
  rpza: Fix a buffer size check
  xxan: Disallow odd width
  xan: Only read within the data that actually was initialized
  xan: Use bytestream2 to limit reading to within the buffer
  pcx: Consume the whole packet if giving up due to missing palette
  pngdec: Stop trying to decode once inflate returns Z_STREAM_END
  mov: Make sure the read sample count is nonnegative
  bfi: Add some very basic sanity checks for input packet sizes
  bfi: Avoid divisions by zero
  electronicarts: Add more sanity checking for the number of channels
  riffdec: Add sanity checks for the sample rate

Conflicts:
	libavcodec/pcx.c
	libavcodec/xan.c
	libavformat/mov.c
	libavformat/riff.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-08 01:41:20 +02: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
Michael Niedermayer
55aedd679a Merge commit 'ce1dacb435460dda1f9d453eaaeac44bd502aca4' into release/1.1
* commit 'ce1dacb435460dda1f9d453eaaeac44bd502aca4':
  rl2: Avoid a division by zero
  wtv: Add more sanity checks for a length read from the file
  segafilm: Validate the number of audio channels
  qpeg: Add checks for running out of rows in qpeg_decode_inter
  mpegaudiodec: Validate that the number of channels fits at the given offset
  asvdec: Verify the amount of extradata
  idroqdec: Make sure a video stream has been allocated before returning packets
  rv10: Validate the dimensions set from the container
  xmv: Add more sanity checks for parameters read from the bitstream
  ffv1: Make sure at least one slice context is initialized
  truemotion2: Use av_freep properly in an error path
  eacmv: Make sure a reference frame exists before referencing it
  mpeg4videodec: Check the width/height in mpeg4_decode_sprite_trajectory
  ivi_common: Make sure color planes have been initialized
  mov: Don't use a negative duration for setting other fields

Conflicts:
	libavcodec/eacmv.c
	libavcodec/ffv1.c
	libavcodec/mpeg4videodec.c
	libavcodec/mpegaudiodec.c
	libavcodec/qpeg.c
	libavformat/mov.c
	libavformat/wtv.c
	libavformat/xmv.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-08 01:06:45 +02:00
Michael Niedermayer
af26185bdc Merge commit '163196562fe744149ef599d754c30c08a9898381' into release/1.1
* commit '163196562fe744149ef599d754c30c08a9898381':
  oggparseogm: Convert to use bytestream2
  rv34: Check the return value from ff_rv34_decode_init
  matroskadec: Verify realaudio codec parameters
  mace: Make sure that the channel count is set to a valid value
  svq3: Check for any negative return value from ff_h264_check_intra_pred_mode
  vp3: Check the framerate for validity
  cavsdec: Make sure a sequence header has been decoded before decoding pictures
  vocdec: Don't update codec parameters mid-stream
  sierravmd: Do sanity checking of frame sizes
  omadec: Properly check lengths before incrementing the position
  mpc8: Make sure the first stream exists before parsing the seek table

Conflicts:
	libavcodec/mace.c
	libavformat/oggparseogm.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-08 00:49:18 +02:00
Michael Niedermayer
af1fb1d467 Merge commit 'f8a72f041c049e812dfa1f32156327e9778f5710' into release/1.1
* commit 'f8a72f041c049e812dfa1f32156327e9778f5710':
  mpc8: Check the seek table size parsed from the bitstream
  zmbvdec: Check the buffer size for uncompressed data
  ape: Don't allow the seektable to be omitted
  shorten: Break out of loop looking for fmt chunk if none is found
  shorten: Use a checked bytestream reader for the wave header
  smacker: Make sure we don't fill in huffman codes out of range
  smacker: Avoid integer overflow when allocating packets
  smacker: Don't return packets in unallocated streams
  dsicin: Add some basic sanity checks for fields read from the file

Conflicts:
	libavcodec/shorten.c
	libavcodec/smacker.c
	libavcodec/zmbv.c
	libavformat/mpc8.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-08 00:24:54 +02:00
Reinhard Tartler
a9fc88ea93 Prepare for 9.10 RELEASE 2013-10-04 19:14:27 -04:00
Martin Storsjö
23e4284160 h263dec: Remove a hack that can cause infinite loops
The actual usefulness of the hack is not known, and it does cause
infinite loops with some broken input files.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 8812a8057f539845f6801cafdf6c481a59e96b48)

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-10-05 00:31:31 +03:00
Martin Storsjö
42c7ed49a9 mpegvideo: Initialize chroma_*_shift and codec_tag even if the size is 0
This fixes breakage in a few fate tests on certain setups
(that for some reason didn't break on OS X) after the previous
commit (8812a8057). Currently, some video streams are initialized
in ff_MPV_common_init with width/height set at 0 and only changed
to a proper video size with ff_MPV_common_frame_size_change later.

The breakage was diagnosed by Anton Khirnov.

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

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-10-05 00:31:20 +03:00
Martin Storsjö
494f2d4f9e vc1dec: Make sure last_picture is initialized in vc1_decode_skip_blocks
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 5e25fdbfe01635cfc650ac4adc27d434b2df0d64)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

Conflicts:
	libavcodec/vc1dec.c
2013-10-04 04:45:35 +02:00
Michael Niedermayer
9597807ab1 vc1dec: Don't decode slices when the latest slice header failed to decode
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>

Conflicts:
	libavcodec/vc1dec.c
2013-10-04 04:45:35 +02:00
Martin Storsjö
99fe4c577f r3d: Add more input value validation
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>

Conflicts:
	libavformat/r3d.c
2013-10-04 04:45:35 +02:00
Martin Storsjö
98e1f0a2db fraps: Make the input buffer size checks more strict
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>

Conflicts:
	libavcodec/fraps.c
2013-10-04 04:45:34 +02:00
Martin Storsjö
3ee5458aa8 svq3: Avoid a division by zero
If the height is zero, the decompression will probably end up
failing due to not fitting into the allocated buffer later
anyway, so this doesn't need any more elaborate check.

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 601c2015bc16f0b281160292a6a760cbbbb0eacb)
2013-10-04 04:45:34 +02:00
Martin Storsjö
99f953b3fe rmdec: Validate the fps value
Abort if it is invalid if strict error checking has been requested.

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 0f310a6f333b016d336674d086045e8473fdf918)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

Conflicts:
	libavformat/rmdec.c
2013-10-04 04:45:34 +02:00
Martin Storsjö
9b9aee27f4 twinvqdec: Check the ibps parameter separately
This is required, since invalid parameters actually could
pass the switch check below.

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 c77d409bf95954aceb762dd800d1ee2868c4b0d4)
2013-10-04 04:45:24 +02:00
Martin Storsjö
7e350b7ddd pcx: Check the packet size before assuming it fits a palette
This fixes reads out of bounds.

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 d1d99e3befea5d411ac3aae72dbdecce94f8b547)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

Conflicts:
	libavcodec/pcx.c
2013-10-04 03:52:11 +02:00
Martin Storsjö
fc4d11ec9b asfdec: Check the return value of asf_read_stream_properties
This makes sure errors in setting stream parameters are passed
on to the caller. This avoids successfully opening files while
some parameters aren't filled in properly.

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 cc41167aede4c101ad17eeffa8f39bb6c23d3dad)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-04 03:52:11 +02:00
Martin Storsjö
f06e39fe6b rpza: Fix a buffer size check
We read 2 bytes for 15 out of 16 pixels, therefore we need to
have at least 30 bytes, not 16.

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 7ba0cedbfeff5671b264d1d7e90777057b5714c6)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-04 03:52:11 +02:00
Anton Khirnov
fd2ba1807e mxfdec: set audio timebase to 1/samplerate
Fixes sync in some samples (e.g. bugs 7581 and 8374 in VLC).
Based on a commit by Matthieu Bouron <matthieu.bouron@gmail.com>

Reported-by: Jean-Baptiste Kempf <jb@videolan.org>
CC: libav-stable@libav.org
(cherry picked from commit 93370d12164236d59645314871a1d6808b2a8ddb)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-04 03:52:11 +02:00
Martin Storsjö
3ac156b707 xxan: Disallow odd width
Decoded data is always written in pairs within this decoder.
This fixes writes out of bounds.

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 aa0dd52434768da64f1f3d8ae92bcf980c1adffc)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-04 03:52:11 +02:00
Martin Storsjö
09ace619d6 xan: Only read within the data that actually was initialized
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 fc739b3eefa0b58d64e7661621da94a94dbc8a82)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-04 03:52:10 +02:00
Martin Storsjö
145de32896 xan: Use bytestream2 to limit reading to within the buffer
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 30db94dc399f6e4ef8905049d9b740556f0fce47)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-04 03:52:10 +02:00
Martin Storsjö
812955a12b pcx: Consume the whole packet if giving up due to missing palette
Previously, we returned 0, meaning successful decoding but 0
bytes consumed, leading to an infinite loop.

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 9fb0de86b49e9fb0709a8ad1e1875e35da841887)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-04 03:52:10 +02:00
Martin Storsjö
a63e83cd4b pngdec: Stop trying to decode once inflate returns Z_STREAM_END
If the input buffer contains more data after the deflate stream,
the loop previously left running infinitely, with inflate returning
Z_STREAM_END.

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 a81cad8f86d1feb7e4bfae29e43f3e994935a5c7)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-04 03:52:10 +02:00
Martin Storsjö
c10f3fed25 mov: Make sure the read sample count is nonnegative
This avoids setting a negative number of frames, ending up with a
negative average 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 c231987662194d009dd91bfc57c678e0e70ca161)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-04 03:52:10 +02:00
Martin Storsjö
04d2f9ace3 mvi: Add sanity checking for the audio frame size
This avoids a division by zero.

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 28ff439efd2362fb21e1a78610737f2e26a72d8f)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-04 03:52:09 +02:00
Martin Storsjö
10f384e4f5 bfi: Add some very basic sanity checks for input packet sizes
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 640a2427aafa774b83316b7a8c5c2bdc28bfd269)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-04 03:52:09 +02:00
Martin Storsjö
78aa2ed620 alac: Do bounds checking of lpc_order read from the bitstream
In lpc_prediction(), we write up to array element 'lpc_order' in
an array allocated to hold 'max_samples_per_frame' elements.

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 59480abce7e4238e22b3a4a904a9fe6abf4e4188)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-04 03:52:09 +02:00
Martin Storsjö
ad1223d6bc bfi: Avoid divisions by zero
If a zero-length video packet is to be returned, just return
AVERROR(EAGAIN) and switch back to the audio stream.

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 9fc7184d1a9af8d97b3fc5c2ef9d0a647d6617ea)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-04 03:52:09 +02:00
Martin Storsjö
a89868d714 electronicarts: Add more sanity checking for the number of channels
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 a9221e39600a31ee13e736e9e47743cde23f0280)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

Conflicts:
	libavformat/electronicarts.c
2013-10-04 03:52:09 +02:00
Martin Storsjö
607863acae riffdec: Add sanity checks for the sample rate
This avoids a division by zero for G726.

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 d07aa3f02b73ab1371c13ac7898338380ca0932b)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-04 03:52:09 +02:00
Martin Storsjö
2ff935a060 xwma: Avoid division by zero
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 adc09136a4a63b152630abeacb22c56541eacf60)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-04 03:52:08 +02:00
Martin Storsjö
2e4c649b3e avidec: Make sure a packet is large enough before reading its data
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 8d07258bb6063d0780ce2d39443d6dc6d8eedc5a)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

Conflicts:
	libavformat/avidec.c
2013-10-04 03:52:08 +02:00
Martin Storsjö
60701469ab vqf: Make sure the bitrate is in the valid range
Even if the sample rate is valid, an invalid bitrate could
pass the mode combination test below.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 68ff9981283a56c731f00c2ee7901103665092fc)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-04 03:52:08 +02:00
Martin Storsjö
4d60ab62e0 vqf: Make sure sample_rate is set to a valid value
This avoids divisions by zero later (and possibly assertions in
time base scaling), since an invalid rate_flag combined with an
invalid bitrate below could pass the mode combination test.

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 9277050e2918e0a0df9689721a188a604d886616)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-04 03:52:08 +02:00
Martin Storsjö
8bd27a167b electronicarts: Check packet sizes before reading
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 f7e616959aff8706edccdae763c24c897c449f6f)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-04 03:26:30 +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
Martin Storsjö
a6a8f66608 vc1dec: Undo mpegvideo initialization if unable to allocate tables
Previously, s->context_initialized was left set to 1
if ff_vc1_decode_init_alloc_tables failed, skipping the
initialization completely on the next decode call.

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 b772b0e28eba6abf76d86ee8c6e459a86642db5a)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-04 03:26:29 +02:00
Martin Storsjö
b62704891d vc1dec: Fix leaks in ff_vc1_decode_init_alloc_tables on errors
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 ede508443e4bf57dc1e019fac81bf6244b88fbd3)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-04 03:26:29 +02:00
Martin Storsjö
0c8c6b4419 wnv1: Make sure the input packet is large enough
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 91be1103fd1f79d381edf268c32f4166b6c3b6d8)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-04 03:26:29 +02:00
Martin Storsjö
97b6916f93 dcadec: Validate the lfe parameter
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 a9d50bb578ec04c085a25f1e023f75e0e4499d5e)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-04 03:26:29 +02:00
Martin Storsjö
ce1dacb435 rl2: Avoid a division by zero
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 3ca14aa5964ea5d11f7a15f9fff17924d6096d44)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-04 03:26:28 +02:00
Martin Storsjö
78dc022f6f wtv: Add more sanity checks for a length read from the file
Also make sure the existing length check can't overflow.

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 83c285f88016b087c2f0f4b9ef356ad8ef12d947)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-04 03:26:28 +02:00
Martin Storsjö
5379c5184b segafilm: Validate the number of audio channels
This avoids divisions by zero later.

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 82e266c6d3fbf3cc74e515b883e66543381a0f2c)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-04 03:26:28 +02:00
Martin Storsjö
4d90550cf9 qpeg: Add checks for running out of rows in qpeg_decode_inter
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 7a5a55722749a3ab77941914707277b147322cbe)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-04 03:26:28 +02:00
Martin Storsjö
bacf5db196 mpegaudiodec: Validate that the number of channels fits at the given offset
This is similar to the fix in 35cbc98b.

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 e9d61de96c113ee0ef8082833c7e682df0e23eec)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-04 03:26:28 +02:00
Martin Storsjö
5358f1b507 asvdec: Verify the amount of extradata
The init function reads one byte of extradata.

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 f50803354c6acb4575379d7c54ca48ec5d36dd61)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-04 03:26:27 +02:00
Martin Storsjö
de75bc01cd idroqdec: Make sure a video stream has been allocated before returning packets
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 bcbe4f3ceb6ee0210d3a401963518906c8b9b230)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-04 03:26:27 +02:00
Martin Storsjö
0b0f1cd44e rv10: Validate the dimensions set from the container
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 5372cda67109848d22146289e401669266217e80)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-04 03:26:27 +02:00
Martin Storsjö
00516b5491 xmv: Add more sanity checks for parameters read from the bitstream
Since the number of channels is multiplied by 36 and assigned to
to a uint16_t, make sure this calculation didn't overflow. (In
certain cases the calculation could overflow leaving the
truncated block_align at 0, leading to divisions by zero later.)

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 d4c2a3740fb95f952a87ba320d2bf31f126bdf68)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-04 03:26:27 +02:00
Martin Storsjö
3706c22992 ffv1: Make sure at least one slice context is initialized
This avoids crashes when initializing the range coder for
the first slice context.

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 b1db33159fdc2da4bdd8c75e4ff9a7dd0ef2f0c2)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-04 03:26:27 +02:00
Martin Storsjö
eac1c3f384 truemotion2: Use av_freep properly in an error path
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 c39f7eba01cd656e8f0eed592f93d11814736650)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-04 03:26:27 +02:00
Martin Storsjö
163196562f oggparseogm: Convert to use bytestream2
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 19b9659f3174599e8685d329c4330b1ea8c4c6db)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-04 03:26:26 +02:00
Martin Storsjö
2e12af4587 eacmv: Make sure a reference frame exists before referencing it
This is similar to an existing check for the second-last frame
from 062421e3.

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 ea78a348d86a3a733f6c1e0a65cfdd8283d924b9)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

Conflicts:
	libavcodec/eacmv.c
2013-10-04 03:26:26 +02:00
Martin Storsjö
20c8f17629 rv34: Check the return value from ff_rv34_decode_init
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 711c970168297683860422e95d6b7e37ee3c8367)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-04 03:26:26 +02:00
Martin Storsjö
c8c93795e4 mpeg4videodec: Check the width/height in mpeg4_decode_sprite_trajectory
This avoids a potential division by zero.

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 f875a732e36786d49f3650e3235272891a820600)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-04 03:26:26 +02:00
Martin Storsjö
38bd229af9 ivi_common: Make sure color planes have been initialized
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 a92538b7c0defc86c55fb91f55dfa36aad192673)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-04 03:26:26 +02:00
Martin Storsjö
fe8bc7d1ee mov: Don't use a negative duration for setting other fields
Some files have the duration set to -1 in the mdhd atom, more
or less legitimately. (We produce such files ourselves, for the
initial duration in fragmented mp4 files.)

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 7f8d41eb097e8d4223c9caf97dd332a2fdb29d52)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-04 03:26:26 +02:00
Martin Storsjö
9f7a8b8f8f matroskadec: Verify realaudio codec parameters
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 569d18aa9dc989c37bb4d4b968026fe5afa6fff9)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-04 03:26:25 +02:00
Martin Storsjö
9272aa4698 mace: Make sure that the channel count is set to a valid value
Also return a proper error code.

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 e1f3847f860a1094a46be4c5f10db8df616c3135)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

Conflicts:
	libavcodec/mace.c
2013-10-04 03:26:25 +02:00
Martin Storsjö
aeca97a7b5 svq3: Check for any negative return value from ff_h264_check_intra_pred_mode
Also pass on any returned error code.

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 1115689d54ea95a084421f5a182b8dc56cbff978)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

Conflicts:
	libavcodec/svq3.c
2013-10-04 03:26:25 +02:00
Martin Storsjö
b4c479a82a vp3: Check the framerate for validity
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 6fc8226e29055858f28973bb3d27b63b3b65e616)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-04 03:26:25 +02:00
Martin Storsjö
9f883e75e6 cavsdec: Make sure a sequence header has been decoded before decoding pictures
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 e90a6846c2c006fbebd00e1f2789f4a86fafacef)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

Conflicts:
	libavcodec/cavsdec.c
2013-10-04 03:26:24 +02:00
Martin Storsjö
e47543eda5 vocdec: Don't update codec parameters mid-stream
If we really want to support parameter changes, they need to be
signalled along with the AVPackets as parameter change side data,
not just changing the AVCodecContext parameters when a packet
is demuxed (since there may be other earlier packets yet undecoded).

Something similar was already done for the sample rate in 0883109b2,
but some parameters were left changeable.

This avoids having to recheck the channel count for validity for
each decoded frame in (ad)pcm decoders, unless the decoders
explicitly say that they accept parameter changes.

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 5bbfe193a0a41bd2adb648c8c3f6901a575734a2)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-03 23:31:38 +02:00
Martin Storsjö
153deed18b sierravmd: Do sanity checking of frame sizes
Limit the size to INT_MAX/2 (for simplicity) to be sure that
size + BYTES_PER_FRAME_RECORD won't overflow.

Also factorize other existing error return paths.

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 0ef1660a6365ce60ead8858936b6f3f8ea862826)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-03 23:31:34 +02:00
Martin Storsjö
9eba02d5dd omadec: Properly check lengths before incrementing the position
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 342c43d154e586bc022c86b168fe8d36f69da9d3)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-03 23:31:22 +02:00
Martin Storsjö
557df77eab mpc8: Make sure the first stream exists before parsing the seek table
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 17d57848fc14e82f76a65ffb25c90f2f011dc4a0)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-03 20:29:36 +02:00
Martin Storsjö
f8a72f041c mpc8: Check the seek table size parsed from the bitstream
Limit the size to INT_MAX/2 (for simplicity) to be sure that
size + FF_INPUT_BUFFER_PADDING_SIZE won't overflow.

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 459f2b393a3f89ed08d10fbceb4738d1429f268e)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-03 20:29:34 +02:00
Michael Niedermayer
9e505065b5 zmbvdec: Check the buffer size for uncompressed data
Also don't pointlessly set the buffer size to 1 after copying
one packet.

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 0d61f260010707f3028b818e8b24598e1a83d696)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-03 20:29:33 +02:00
Martin Storsjö
eba112b4e3 ape: Don't allow the seektable to be omitted
The seektable is required for filling in ape->frames[i].pos
further down.

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 183b9d843a9533774fabd3984a52f3987001acbc)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-03 20:29:31 +02:00
Martin Storsjö
d411f07751 shorten: Break out of loop looking for fmt chunk if none is found
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 b26742cc308552f242ee2bf93b07a3ff509f4edc)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-03 20:29:29 +02:00
Martin Storsjö
8484351749 shorten: Use a checked bytestream reader for the wave header
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 49568851bf1700e3d9ea9cda29208d0df3c2c38b)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-03 20:29:27 +02:00
Martin Storsjö
01a58b439d smacker: Make sure we don't fill in huffman codes out of range
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 0679cec6e8802643bbe6d5f68ca1110a7d3171da)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-03 20:29:25 +02:00
Martin Storsjö
47bb4d888e smacker: Avoid integer overflow when allocating packets
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 710b0e27025948b7511821c2f888ff2d74a59e14)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-03 20:29:24 +02:00
Martin Storsjö
057f655dc6 smacker: Don't return packets in unallocated streams
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 8d928023f953a28692ba27071a448259134b103b)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-03 20:29:21 +02:00
Martin Storsjö
3bd0cd2677 dsicin: Add some basic sanity checks for fields read from the file
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 48d6556dd46d4f4fac10d0f4a819e314887cd50e)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-03 20:29:15 +02:00
Timothy Gu
a4acb5b900 doc/encoders: add doc for AAC encoder
Thanks-to: Kostya Shishkov <kostya.shishkov@gmail.com>
Signed-off-by: Timothy Gu <timothygu99@gmail.com>
Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
(cherry picked from commit 0e11790cf7eef3b0f38a64486da1e3fb8c7f14b8)

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
2013-09-22 15:22:34 -07:00
Timothy Gu
c42fd4c6ee doc/ffmpeg-formats: Add documentation for 2 parameters that have been missing
(partially cherry picked from commit b7dd4598630fb1f890ae060f21a9ec92a103f22d)

Signed-off-by: Timothy Gu <timothygu99@gmail.com>

Conflicts:
	doc/formats.texi
2013-09-22 15:11:00 -07:00
Timothy Gu
3eee21406a doc/encoders: improve libvo-aacenc doc
Signed-off-by: Timothy Gu <timothygu99@gmail.com>
Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
(cherry picked from commit 81bbe49a0e588aa899f37a567808ba8926d798d6)

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
2013-09-22 15:01:32 -07:00
Timothy Gu
852ee0e0ad doc/encoders: Remove options that were not there when branch was cut from master
Signed-off-by: Timothy Gu <timothygu99@gmail.com>
2013-09-22 14:59:41 -07:00
Timothy Gu
ed2c15eadc doc/encoders: reformat and add some clarification in libtwolame doc
Signed-off-by: Timothy Gu <timothygu99@gmail.com>
Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
(cherry picked from commit e45e72f5f89ef5a5791562cfcb935028b46ecd0a)

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
2013-09-22 14:59:41 -07:00
Timothy Gu
4ad0330b3d doc/encoders: reformat libmp3lame doc
Signed-off-by: Timothy Gu <timothygu99@gmail.com>
Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
(cherry picked from commit 40b8350b57adaa9aaf6731bac5130d4fec1639c3)

Conflicts:
	doc/encoders.texi
2013-09-22 14:59:41 -07:00
Carl Eugen Hoyos
9fde820d8e Use rc_max_rate if no video bit_rate was specified when muxing mxf_d10.
Fixes ticket #2945.

Reviewed-by: Matthieu Bouron
(cherry picked from commit d73565d5ddf41d4b7805327cdb271c59d8c3fc59)
2013-09-12 23:17:32 +02:00
Carl Eugen Hoyos
b5e2ef771d Store the video bit_rate in the context when muxing mxf.
This will allow using rc_max_rate if no bit_rate is specified (on remuxing).

Reviewed-by: Matthieu Bouron
(cherry picked from commit 52cf08b4c8859f7cac010a7a59f7aa369384ad85)
2013-09-12 23:17:31 +02:00
Clément Bœsch
63e370b2cf avformat/subtitles: check lower bound for duration overlap seeking.
(cherry picked from commit 1ca4bf930bab681a79fb591330043675c7cfd798)
2013-09-10 21:44:43 +02:00
Clément Bœsch
af225c41d4 avformat/vobsub: fix seeking.
(cherry picked from commit f8678dcef3c5b0ea82e898e1f419863409fa135f)
2013-09-10 21:44:39 +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
Paul B Mahol
8715ca0b82 avformat/matroskaenc: remove bogus prores tag
Fixes: ffmpeg -i input -c:v prores output.mkv

Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit 14851ca5f5a3af140085e82589e28e06c7cdefdc)

Conflicts:
	libavformat/matroskaenc.c
2013-09-08 22:37:48 +02:00
Sean McGovern
4d073ddac9 Update Changelog
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-09-08 08:15:21 +02:00
Sean McGovern
007f3f4165 Prepare for 9.9 RELEASE
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-09-08 08:12:07 +02:00
Michael Niedermayer
6d2e3efd7c avcodec/vcr1: return the actual number of consumed bytes
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a4e70918316c6d1423e559aad15823a5e0453fcf)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-07 16:29:27 +02:00
Michael Niedermayer
fbbd6317e2 avcodec/vcr1: replace redundant checks from libav (8aba7968dd604aae91ee42cbce0be3dad7dceb30) by asserts
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 164b67ca281fa5a47b965a858c7783aa547091b8)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-07 16:29:22 +02:00
Michael Niedermayer
87908de715 avcodec: add emuedge_linesize_type
Currently all uses of the emu edge code as well as the code itself
assume int linesize
changing some but not changing all would introduce a security issue
once all use this typedef a simple search and replace can be
done to switch them all to ptrdiff_t

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

Conflicts:

	libavcodec/videodsp.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-07 14:30:17 +02:00
Michael Niedermayer
de5e003369 Merge remote-tracking branch 'qatar/release/9' into release/1.1
* qatar/release/9:
  mpegvideo: Avoid 32-bit wrapping of linesize multiplications
  mjpegb: Detect changing number of planes in interlaced video
  alac: Check that the channels fit at the given offset
  4xm: Check that the read track value is non-negative

Conflicts:
	libavcodec/alac.c
	libavcodec/mjpegdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-07 14:29:09 +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
Michael Niedermayer
6bfa823b70 Merge commit '8dc4b2c92e492aa172327d10c926d5ca3a04371c' into release/1.1
* commit '8dc4b2c92e492aa172327d10c926d5ca3a04371c':
  pictordec: break out of both decoding loops when y drops below 0
  vcr1: add sanity checks

Conflicts:
	libavcodec/pictordec.c
	libavcodec/vcr1.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-07 13:13:12 +02:00
Michael Niedermayer
701543a081 avcodec/mjpegdec: Add some sanity checks to ljpeg_decode_rgb_scan()
These prevent the rgb ljpeg code from being run on parameters that it doesnt
support. No testcase available but it seems possible to trigger these.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-07 12:54:41 +02:00
Michael Niedermayer
580418bd55 avfilter/vf_fps: make sure the fifo is not empty before using it
Fixes Ticket2905

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-07 12:54:40 +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
Luca Barbato
1e9e311e21 dv: Add a guard to not overread the ppcm array
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 7ee191cab0dc44700f26c5784e2adeb6a779651b)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

Conflicts:
	libavformat/dv.c
2013-09-07 12:09:56 +02:00
Luca Barbato
0eb465f981 nuv: check ff_rtjpeg_decode_frame_yuv420 return value
CC: libav-stable@libav.org
(cherry picked from commit 85ac12587bfef970d0e0e4abc292df346daf8478)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

Conflicts:
	libavcodec/nuv.c
2013-09-07 12:09:06 +02:00
Martin Storsjö
b01e4d80c6 mpegvideo: Avoid 32-bit wrapping of linesize multiplications
This makes sure that linesize * start_y doesn't overflow, so that
emulated_edge_mc can get back the original value if needed.

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 a711a2cb473dc95708f371a82c85c97fe789b5c2)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-09-07 10:26:28 +02:00
Michael Niedermayer
68c9904669 mjpegb: Detect changing number of planes in interlaced video
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 af11fa5409cc72fc45ca7f3527400beca10967b9)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-09-07 10:26:14 +02:00
Martin Storsjö
790606cfe9 alac: Check that the channels fit at the given offset
The code tries to decode a number of channels at the
offset given by the ff_alac_channel_layout_offsets table.
Even if the number of channels decoded so far doesn't
exceed the total number of channels, we need to check that
we actually can decode that number of channels at this offset
as well.

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 35cbc98b720db95b923cb2d745f77bb2ee4363dc)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-09-07 10:26:04 +02:00
Martin Storsjö
7b9bcd993c 4xm: Check that the read track value is non-negative
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 d719981273bc779c7d1e879d88404fd867f93a0e)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

Conflicts:
	libavformat/4xm.c
2013-09-07 10:25:48 +02:00
Martin Storsjö
aade60ab16 matroskadec: Check that .lang was allocated and set before reading it
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 5bcd3ae5b167fb74215520b01d5d810e0c8986ab)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-09-07 10:18:59 +02:00
Martin Storsjö
3d91117df0 alac: Limit max_samples_per_frame
Otherwise buffer size calculations in allocate_buffers could
overflow later, making the code think a large enough buffer
actually was allocated.

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 f7c5883126f9440547933eefcf000aa78af4821c)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-09-07 10:18:41 +02:00
Anton Khirnov
9486e98712 ape demuxer: check for EOF in potentially long loops
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry-picked from commit 488b2984fece7ad0c2596826fee18e74aa904667)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-09-07 10:18:18 +02:00
Anton Khirnov
f3c7e604fa 4xm: check that bits per sample is strictly positive
Avoids a divide by zero.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit a7c1689dedd11689edb30088d467ac03f9b8d1cf)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-09-07 10:15:13 +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
Anton Khirnov
1e9d234c0c pictordec: pass correct context to avpriv_request_sample
Fixes invalid reads.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry-picked from commit fe9bb61f9a16be19ad91875632c39e44b7a99a8a)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-09-07 10:14:30 +02:00
Anton Khirnov
8dc4b2c92e pictordec: break out of both decoding loops when y drops below 0
Otherwise picmemset can get called with negative y, resulting in an
invalid write.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 5f7aecde02a95451e514c809f2794c1deba80695)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-09-07 10:13:48 +02:00
Anton Khirnov
251b4655be vcr1: add sanity checks
Fixes invalid reads with corrupted files.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 8aba7968dd604aae91ee42cbce0be3dad7dceb30)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-09-07 10:10:09 +02:00
Carl Eugen Hoyos
1a65ce923a Read h264 headers from v4l2 to allow stream-copying.
Fixes ticket #2882.
Analyzed and tested by William C Bonner.
(cherry picked from commit e337c9d56408dc00a15887309488a1ff5cb06ba3)
2013-09-05 23:08:32 +02:00
Paul B Mahol
b438451b7e w64dec: fix end position of summarylist guid
Noticed-by: James Almer

Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit 3e36dc8626f4721ea749286dae40169ee5cb7d04)
2013-09-05 23:08:30 +02:00
Paul B Mahol
f1f8c0e558 w64dec: fix skipping of unknown guids
Regression since 14d50c1.
Fixes #2932.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit 79b70e47a463057a3a48353ee1dd58671c11f86c)
2013-09-05 23:08:28 +02:00
Carl Eugen Hoyos
c93874c3a8 Avoid a deadlock when decoding wma.
Fixes ticket #2925.
(cherry picked from commit ec8a4841f7e81040f9a2757f23e70dff5e6b33a4)
2013-09-02 09:39:32 +02:00
Michael Niedermayer
e27fab0e6e avformat/lxfdec: use a parser to parse video frame headers
lxf needs a parser (or would need to set a few fields explicitly).
Fixes Ticket2917

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8349be852be7f68fe0590584fd46c4d5f1c16b3d)
2013-09-01 10:03:40 +02:00
Michael Niedermayer
f743c4ece8 avformat/avidec: match first index and first packet size=0 handling
Fixes Ticket2861

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

Conflicts:
	libavformat/avidec.c
2013-08-31 09:43:04 +02:00
Michael Niedermayer
86bf0a8871 update for 1.1.6
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-31 04:55:35 +02:00
Michael Niedermayer
558d0b9483 avcodec/dsputil: fix signedness in sizeof() comparissions
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 454a11a1c9c686c78aa97954306fb63453299760)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-31 04:31:04 +02:00
Michael Niedermayer
f78a3868fd ffv1dec: Check bits_per_raw_sample and colorspace for equality in ver 0/1 headers
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b05cd1ea7e45a836f7f6071a716c38bb30326e0f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-31 04:31:04 +02:00
Michael Niedermayer
df2fc63543 ffv1dec: check that global parameters dont change in version 0/1
Such changes are not allowed nor supported

Fixes Ticket2906

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-31 04:31:04 +02:00
Michael Niedermayer
890c36d7ff avcodec/ffv1dec: check global header version
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 20b965a1a43ae88b7ae95635d5a3570e7dc2bbd4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-31 04:31:04 +02:00
Michael Niedermayer
a2e7fd406c avcodec/pngdsp: fix (un)signed type in end comparission
Fixes out of array accesses
Fixes Ticket2919

Found_by: ami_stuff
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 86736f59d6a527d8bc807d09b93f971c0fe0bb07)
2013-08-30 23:39:02 +02:00
Michael Niedermayer
7043e435dd Merge remote-tracking branch 'jamrial/release/1.1' into release/1.1
* jamrial/release/1.1:
  avformat/matroskadec: check out_samplerate before using it in av_rescale()
  matroskadec: Improve TTA duration calculation
  matroskaenc: simplify mkv_check_tag()
  lavf/matroskaenc: Check for valid metadata before creating tags

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-28 23:18:46 +02:00
Michael Niedermayer
f7fcd40e63 matroska_read_seek: Fix used streams for subtitle index compensation
Might fix Ticket1907 (I have no testcase so i cant test)

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-28 22:58:52 +02:00
Stefano Sabatini
b7a4b4c145 doc/texi2pod: fix @ref substitution rule, disallow "}" within the fields
Fix potential spurious substitution.
(cherry picked from commit 9167db3829f360f241255d4240ba6b7135ab4111)

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
2013-08-28 09:35:20 -07:00
Stefano Sabatini
de1609bc2d doc/texi2pod: fix warnings introduced in e7e14bc69a606a6bec82efef729263cd38f122d4
The variable "$section" was replaced by "$chapter".
(cherry picked from commit c0c06c1bba80c4bee162a3c40eec678ddc65571d)

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
2013-08-28 09:35:20 -07:00
Luca Barbato
bd055c1768 doc: support multitable in texi2pod
(cherry picked from commit 5ea5ffc9cee1b91eed471fff2f51d771222cf8d2)

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
2013-08-28 09:35:20 -07:00
Stefano Sabatini
2892b01227 doc/texipod: add rule to correctly interpret @ref{ANCHOR,XREF,SECTION_NAME,...}
This allows to name an internal reference in the POD/MAN output.
(cherry picked from commit c499d45c6bea8d7bbbb7a819c53fe9766136bf29)

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
2013-08-28 09:35:20 -07:00
Stefano Sabatini
e4a49ae561 doc/texi2pod.pl: skip printing chapter names if they are disabled
(cherry picked from commit c838701ce4515bd51f7827be0b20f256ba5c69f3)

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
2013-08-28 09:35:20 -07:00
Stefano Sabatini
1feef46b90 doc/codecs: fix dangling reference to codec-options chapter
(cherry picked from commit b4bd21b7fe2ad8be59b16538448586814e5db65b)

Signed-off-by: Timothy Gu <timothygu99@gmail.com>

Conflicts:
	doc/codecs.texi
	doc/encoders.texi
2013-08-28 09:35:20 -07:00
Stefano Sabatini
19382a2a10 doc/filters: review introductory example and explanation
In particular, fix wrong vertical mirroring command, and clarify
and extend explanation.

Based on a patch by littlebat <dashing.meng@gmail.com>.

Should fix trac ticket #2413.
(cherry picked from commit 215ca864759a54f45265a51ac57dbfd75cb23da2)

Signed-off-by: Timothy Gu <timothygu99@gmail.com>

Conflicts:
	doc/filters.texi
2013-08-28 09:35:20 -07:00
Timothy Gu
57588cda7b doc/encoders: add libxvid doc
Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
(cherry picked from commit 6b255e5e70c72aa59ff7aed74b4ee976223eb140)

Signed-off-by: Timothy Gu <timothygu99@gmail.com>

Conflicts:
	doc/encoders.texi
2013-08-28 09:35:20 -07:00
Timothy Gu
e5162b3bc9 doc/encoders: add libopus encoder doc
Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
(cherry picked from commit 561e05136f1cbe28a79af1940aa137f70281eef4)

Signed-off-by: Timothy Gu <timothygu99@gmail.com>

Conflicts:
	doc/encoders.texi
2013-08-28 09:35:20 -07:00
Timothy Gu
ee9a440f49 doc/muxers: Add AIFF doc
Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
(cherry picked from commit 4ec46b1160eb549a551823c168905b43922add31)

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
2013-08-28 09:35:19 -07:00
Timothy Gu
5582cfd0e4 doc/decoders: document libopus decoder
Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
(cherry picked from commit 7eb5288f17aad81d5bd1b4d3d46533e457df262c)

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
2013-08-28 09:35:19 -07:00
Timothy Gu
68c9f5cf64 doc/encoders: alphabetically list the encoders
Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
(cherry picked from commit 934df3b0375743ae2b03168a4174edb9f88a6889)

Signed-off-by: Timothy Gu <timothygu99@gmail.com>

Conflicts:
	doc/encoders.texi
2013-08-28 09:35:19 -07:00
Timothy Gu
e36a005749 doc/decoders: Add libopencore-amrwb decoder doc
Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
(cherry picked from commit 83647ace735d1707d4b28345ef77fefe525ea52e)

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
2013-08-28 09:35:19 -07:00
Timothy Gu
9fb9419b02 doc/decoders: Document libopencore-amrnb decoder
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b43860ee0c27279f2fa020ea965c03d359f8f45c)

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
2013-08-28 09:35:19 -07:00
Timothy Gu
23633f4925 doc/decoders: Document libilbc decoder
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8cdea50f6eee1271e24ff0c9590522f8323e87fe)

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
2013-08-28 09:35:19 -07:00
Timothy Gu
be5fef6e0d doc/decoders: Document libgsm decoder
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c16496c3770fa083472ab86146c18dc96c1feea7)

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
2013-08-28 09:35:19 -07:00
Timothy Gu
e3e5779a04 doc/encoders: Add libopencore-amrnb doc
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 9ead06057acfcc43bcb99a63a7c58543007b2847)

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
2013-08-28 09:35:19 -07:00
Timothy Gu
46ecbef251 doc/decoders: Document libcelt
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e3580449221c79cf611995dc7e2fcb61dd867d4c)

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
2013-08-28 09:35:18 -07:00
Timothy Gu
528dd54d15 doc/general: Make the license status of the Android libraries clearer
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6fe419bf73146655961a373c734e9e4d8826c835)

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
2013-08-28 09:35:18 -07:00
Timothy Gu
ccdeedf22c doc/encoders: Add libvo-amrwbenc doc
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0ec65aa1046a4417d5c7dfcf8faeecde60e3fe00)

Signed-off-by: Timothy Gu <timothygu99@gmail.com>

Conflicts:
	doc/encoders.texi
2013-08-28 09:35:18 -07:00
Timothy Gu
5c0dff6c60 doc/encoders: Add libvo-aacenc doc
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ba7cb4807f050c401f8fd7ef1d1065b138358135)

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
2013-08-28 09:35:18 -07:00
Timothy Gu
856bdcd5bc doc/encoders: add documentation for libtwolame
(cherry picked from commit ea038b996d5662702b2247a6aa919dee1cebc0be)

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
2013-08-28 09:35:18 -07:00
Timothy Gu
a5fe40f728 doc/encoders: Add documentation for libmp3lame
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4703a345fb41b14fe28f7e6bf7f60bb2213aa9e0)

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
2013-08-28 09:35:18 -07:00
Michael Niedermayer
359bfa4c27 jpeg2000: check log2_cblk dimensions
Fixes out of array access
Fixes Ticket2895

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

Conflicts:

	libavcodec/jpeg2000dec.c

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-28 13:39:26 +02:00
Michael Niedermayer
bb263cc33a avcodec/rpza: Perform pointer advance and checks before using the pointers
Fixes out of array accesses
Fixes Ticket2850

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-28 13:39:26 +02:00
Michael Niedermayer
f508bf7ff1 avcodec/flashsv: check diff_start/height
Fixes out of array accesses
Fixes Ticket2844

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-28 13:39:26 +02:00
Michael Niedermayer
898c51a016 avformat/paf: Fix integer overflow and out of array read
Found-by:  Laurent Butti <laurentb@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f58cd2867a8af2eed13acdd21d067b48249b14a1)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-28 13:39:26 +02:00
Michael Niedermayer
7fe88bc66c Merge remote-tracking branch 'qatar/release/9' into release/1.1
* qatar/release/9:
  ac3: Return proper error codes
  ac3: Clean up the error paths
  ac3: Do not clash with normal AVERROR

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-28 13:29:29 +02:00
Michael Niedermayer
333e708520 Merge remote-tracking branch 'qatar/release/9' into release/1.1
* qatar/release/9: (21 commits)
  ogg: Fix potential infinite discard loop
  dxa: Make sure the reference frame exists
  h261: check the mtype index
  segafilm: Error out on impossible packet size
  ogg: Always alloc the private context in vorbis_header
  rtjpeg: Use init_get_bits8
  nuv: Reset the frame on resize
  nuv: Use av_fast_realloc
  nuv: return meaningful error codes.
  nuv: Pad the lzo outbuf
  nuv: Do not ignore lzo decompression failures
  rtmp: Do not misuse memcmp
  rtmp: rename data_size to size
  vc1: check mb_height validity.
  vc1: check the source buffer in vc1_mc functions
  bink: Bound check the quantization matrix.
  aac: Check init_get_bits return value
  aac: return meaningful errors
  aac: K&R formatting cosmetics
  oma: correctly mark and decrypt partial packets
  ...

Conflicts:
	libavcodec/aacdec.c
	libavcodec/h261dec.c
	libavcodec/nuv.c
	libavcodec/vc1dec.c
	libavformat/oggparsevorbis.c
	libavformat/omadec.c
	libavformat/rtmpproto.c
	tests/ref/fate/nuv-rtjpeg

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-27 19:13:15 +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
Michael Niedermayer
fd85d03162 Merge commit 'fbbe487b1c1f21339cff9ca86c3dfc495ad1c2c6' into release/1.1
* commit 'fbbe487b1c1f21339cff9ca86c3dfc495ad1c2c6':
  indeo: Sanitize ff_ivi_init_planes fail paths
  indeo5: return proper error codes
  indeo: Bound-check before applying motion compensation
  indeo: Bound-check before applying transform
  indeo4: Validate scantable dimension
  indeo4: Check the quantization matrix index
  indeo4: Do not access missing reference MV
  ac3dec: Increment channel pointers only once per channel
  dca: Respect the current limits in the downmixing capabilities
  dca: Error out on missing DSYNC
  pcm: always use codec->id instead of codec_id
  mlpdec: Do not set invalid context in read_restart_header
  pcx: Do not overread source buffer in pcx_rle_decode
  wmavoice: conceal clearly corrupted blocks
  iff: Do not read over the source buffer
  qdm2: Conceal broken samples
  qdm2: refactor joined stereo support

Conflicts:
	libavcodec/ac3dec.c
	libavcodec/dcadec.c
	libavcodec/iff.c
	libavcodec/indeo4.c
	libavcodec/indeo5.c
	libavcodec/ivi_common.c
	libavcodec/mlpdec.c
	libavcodec/pcx.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-27 17:54:01 +02:00
Luca Barbato
26605efed7 ac3: Return proper error codes
(cherry picked from commit b1f9cdc37ff5d5b391d2cd9af737ab4e5a0fc1c0)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-27 17:28:33 +02:00
Luca Barbato
a32bbe54e4 ac3: Clean up the error paths
(cherry picked from commit 818d1f1a3e89d35213af0bd5dc4a772713951882)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-27 17:28:29 +02:00
Luca Barbato
07bfb254c6 ac3: Do not clash with normal AVERROR
The parsing function return AVERROR and AAC_AC3_PARSE_ERROR values,
make sure they are not misunderstood.

(cherry picked from commit 6258d362b82934a2c27557e0984aed372d98091a)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-27 17:28:23 +02:00
Michael Niedermayer
9b89041a86 Merge commit 'c02d4c1a98aef485be25228b33adb4ce357173e4' into release/1.1
* commit 'c02d4c1a98aef485be25228b33adb4ce357173e4':
  adpcm: Write the correct number of samples for ima-dk4
  imc: Catch a division by zero
  atrac3: Error on impossible encoding/channel combinations
  atrac3: set the getbits context the right buffer_end
  atrac3: fix error handling
  qdm2: check and reset dithering index per channel
  qdm2: formatting cosmetics
  qdm2: use init_static_data
  westwood_vqa: do not free extradata on error in read_header
  vqavideo: check the version
  rmdec: Use the AVIOContext given as parameter in rm_read_metadata()
  avio: Handle AVERROR_EOF in the same way as the return value 0

Conflicts:
	libavcodec/adpcm.c
	libavcodec/qdm2.c
	libavcodec/vqavideo.c
	libavformat/rmdec.c
	libavformat/westwood_vqa.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-27 16:43:09 +02:00
Michael Niedermayer
09fcc2f865 Merge commit 'fa6eef4210c2fd7f7324d558b09311c75987a31e' into release/1.1
* commit 'fa6eef4210c2fd7f7324d558b09311c75987a31e':
  wtv: Mark attachment with a negative stream id
  avconv: do not use lavfi direct rendering with -deinterlace
  avidec: Let the inner dv demuxer take care of discarding
  Update Changelog
  kmvc: Clip pixel position to valid range
  kmvc: use fixed sized arrays in the context
  indeo: reject negative array indexes
  indeo: Cosmetic formatting
  indeo: Refactor ff_ivi_init_tiles and ivi_decode_blocks
  indeo: Refactor ff_ivi_dec_huff_desc
  indeo: use a typedef for the mc function pointer
  indeo: use proper error code

Conflicts:
	Changelog
	ffmpeg.c
	libavcodec/ivi_common.c
	libavformat/wtv.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-27 16:30:57 +02:00
Michael Niedermayer
847d3225a8 Merge commit 'c8fb5d0f383fcbb0da9bdef609c3a826df0064f7' into release/1.1
* commit 'c8fb5d0f383fcbb0da9bdef609c3a826df0064f7':
  Update Changelog
  indeo: check for reference when inheriting mvs
  indeo: use proper error code
  indeo: Properly forward the error codes
  mjpeg: Check the unescaped size for overflows
  wmapro: error out on impossible scale factor offsets
  wmapro: check the min_samples_per_subframe
  wmapro: return early on unsupported condition
  wmapro: check num_vec_coeffs against the actual available buffer
  wmapro: make sure there is room to store the current packet
  lavc: move put_bits_left in put_bits.h
  4xm: do not overread the source buffer in decode_p_block
  4xm: check bitstream_size boundary before using it

Conflicts:
	Changelog
	libavcodec/4xm.c
	libavcodec/mjpegdec.c
	libavcodec/wmaprodec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-27 16:11:44 +02:00
Michael Niedermayer
465742bbbe Merge commit '5c54fc6195e52c329b88cf5a56d18628f0ee0029' into release/1.1
* commit '5c54fc6195e52c329b88cf5a56d18628f0ee0029':
  Prepare for 9.8 RELEASE
  update Changelog
  smacker: check frame size validity
  smacker: pad the extradata allocation
  smacker: check the return value of smacker_decode_tree
  smacker: fix an off by one in huff.length computation
  4xm: do not overread the prestream buffer
  4xm: validate the buffer size before parsing it
  4xm: reject frames not compatible with the declared version
  4xm: drop pointless assert
  4xm: forward errors from decode_p_block
  4xm: fold last_picture lazy allocation in decode_p_frame
  4xm: do not overread while parsing header
  4xm: refactor fourxm_read_header
  4xm: K&R formatting cosmetics
  4xm: use the correct logging context

Conflicts:
	Changelog
	RELEASE
	libavcodec/4xm.c
	libavcodec/smacker.c
	libavformat/4xm.c
	libavformat/smacker.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-27 15:42:14 +02:00
Michael Niedermayer
40b8e7f168 avformat/matroskadec: check out_samplerate before using it in av_rescale()
Prevent assertion failure with damaged input

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 338f8b2eaf36f078eb5cc26ac10e651dc4c48243)
2013-08-26 17:52:49 -03:00
James Almer
77783c7114 matroskadec: Improve TTA duration calculation
Calculate the duration as accurately as possible to improve decoding of samples
where the last frame is smaller than the rest.

Signed-off-by: James Almer <jamrial@gmail.com>
Approved-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit af248fa1174200acb537a6ab1198bb2fed38e884)
2013-08-25 19:41:55 -03:00
Michael Niedermayer
979f97a861 matroskaenc: simplify mkv_check_tag()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 066111bf19518a9f4d836991b34dbfc5ab72a41a)
2013-08-25 18:21:45 -03:00
James Almer
1b16302e54 lavf/matroskaenc: Check for valid metadata before creating tags
Tags must have at least one SimpleTag element to be spec conformant.
Updated lavf-mkv and seek-lavf-mkv FATE references as the tests were affected by
this.

Fixes ticket #2785

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

Conflicts:
	tests/ref/lavf/mkv
2013-08-25 18:20:35 -03:00
Reimar Döffinger
cbc6ded5b7 ogg: Fix potential infinite discard loop
Seeking in certain broken files would cause ogg_read_timestamp
to fail because ogg_packet would go into a state where all packets
of stream 1 would be discarded until the end of the stream.

Bug-Id: 553
CC: libav-stable@libav.org

Signed-off-by: Jan Gerber <j@v2v.cc>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 9a27acae9e6b7d0bf74c5b878af9c42495a546f3)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 16:58:13 +02:00
Luca Barbato
93fbabb60f dxa: Make sure the reference frame exists
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 5ef7c84a9374681c64722a96d91741f3b990af2b)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

Conflicts:
	libavcodec/dxa.c
2013-08-24 16:57:57 +02:00
Luca Barbato
a14ff5b256 h261: check the mtype index
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit c59967fa7cc5bc2fa06b36c17d2c207240c06b3e)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

Conflicts:
	libavcodec/h261dec.c
2013-08-24 16:50:12 +02:00
Luca Barbato
7c30ea5006 segafilm: Error out on impossible packet size
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 5268bd2900effa59b51e0fede61aacde5e2f0b95)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 16:47:57 +02:00
Luca Barbato
e2d32ad18e ogg: Always alloc the private context in vorbis_header
It is possible to have an initial broken header and then valid packets.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 3562684db716d11de0b0dcc52748e9cd90d68132)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 16:47:48 +02:00
Luca Barbato
cea1769fb6 rtjpeg: Use init_get_bits8
CC:libav-stable@libav.org
(cherry picked from commit f13fe6020e6a3871f9b0c96b240e58e6ed4fb5d7)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 16:47:34 +02:00
Luca Barbato
082e3fd469 nuv: Reset the frame on resize
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 16:46:50 +02:00
Luca Barbato
747c320a19 nuv: Use av_fast_realloc
The decompressed buffer can be used after codec_reinit, so it must be
preserved.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 2df0776c2293efb0ac12c003843ce19332342e01)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 16:41:16 +02:00
Anton Khirnov
cf6a34b2a5 nuv: return meaningful error codes.
(cherry picked from commit 3344f5cb747bb1f54cc34878b66dc0536f194720)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 16:41:16 +02:00
Luca Barbato
6537f57782 nuv: Pad the lzo outbuf
And properly update the buf_size with the correct size.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 075dbc185521f193c98b896cd63be3ec2613df5d)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 16:37:10 +02:00
Luca Barbato
c92e37c207 nuv: Do not ignore lzo decompression failures
Update the fate reference since the last broken frame is not decoded
anymore.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit aae159a7cc4df7d0521901022b778c9da251c24e)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 16:37:01 +02:00
Luca Barbato
dd923878e8 rtmp: Do not misuse memcmp
CC: libav-stable@libav.org
(cherry picked from commit 5718e3487ba3b26aba341070be0b6b0b4de45ea3)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

Conflicts:
	libavformat/rtmpproto.c
2013-08-24 16:21:24 +02:00
Luca Barbato
e897e0631a rtmp: rename data_size to size
(cherry picked from commit ba5393a609c723ec8ab7f9727c10fef734c09278)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 16:20:33 +02:00
Luca Barbato
b26c9f4e52 vc1: check mb_height validity.
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 43bacd5b7d3d265a77cd29d8abb131057796aecc)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 16:18:19 +02:00
Luca Barbato
937cedd7c0 vc1: check the source buffer in vc1_mc functions
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 090cd0631140ac1a3a795d2adfac5dbf5e381aa2)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

Conflicts:
	libavcodec/vc1dec.c
2013-08-24 16:17:41 +02:00
Luca Barbato
c5ba226c1b bink: Bound check the quantization matrix.
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 9991298f2c4d9022ad56057f15d037e18d454157)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 16:14:22 +02:00
Luca Barbato
cb31b6ca72 aac: Check init_get_bits return value
Some code paths can call it with invalid length.

CC: libav-stable@libav.org
(cherry picked from commit 71953ebcf94fe4ef316cdad1f276089205dd1d65)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 16:13:56 +02:00
Luca Barbato
b53db58ab7 aac: return meaningful errors
(cherry picked from commit 07c52e2c7c60b087fd023cd9771778973def0b33)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 16:13:44 +02:00
Luca Barbato
d0323b6234 aac: K&R formatting cosmetics
(cherry picked from commit 6d8629aac13692447b54eac795bf74007ebf8987)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 16:13:19 +02:00
Luca Barbato
d502bd7410 oma: correctly mark and decrypt partial packets
Incomplete crypted files would lead to a read after buffer boundary
otherwise.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 2219e27b5b17d146e4ab71a3ed86dfc013fb7a93)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

Conflicts:
	libavformat/omadec.c
2013-08-24 16:11:29 +02:00
Luca Barbato
97e6099c0c oma: check geob tag boundary
Prevent read after buffer boundary on corrupted tag.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 9d0b45ade864f3d2ccd8610149fe1fff53c4e937)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

Conflicts:
	libavformat/omadec.c
2013-08-24 16:10:13 +02:00
Luca Barbato
0b6adcf76b oma: refactor seek function
Properly propagate seek errors from avio and the generic pcm seek.

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

Conflicts:
	libavformat/omadec.c
2013-08-24 16:08:27 +02:00
Luca Barbato
116aa30db4 xl: Make sure the width is valid
CC: libav-stable@libav.org
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 16:01:02 +02:00
Luca Barbato
e6cf47ee9e 8bps: Bound-check the input buffer
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit bd7b4da0f4627bb6c4a7c2575da83fe6b261a21c)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

Conflicts:
	libavcodec/8bps.c
2013-08-24 15:43:13 +02:00
Luca Barbato
f8602ef717 4xm: Reject not a multiple of 16 dimension
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 2f034f255c49050e894ab9b88087c09ebe249f3f)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 15:13:01 +02:00
Luca Barbato
a5bdec1c75 alsdec: Clean up error paths
Fix at least a memory leak.

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

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 12:18:17 +02:00
Luca Barbato
dcbfba3bb6 alsdec: Fix the clipping range
mcc_weightings is only 32 elements.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 70ecc175c7b513a153ac87d1c5d219556ca55070)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 12:18:08 +02:00
Luca Barbato
068bc633f2 dsicinav: Clip the source size to the expected maximum
A packet larger than cin->bitmap_size does not make sense.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit fd8189932147a524fe43532b46baa35e8be92a1b)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 12:17:39 +02:00
Luca Barbato
95275723ae dsicinav: Bound-check the source buffer when needed
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit dd0bfc3a6a310e3e3674ce7742672d689a9a0e93)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 12:17:28 +02:00
Luca Barbato
47cb05d783 dsicinav: K&R formatting cosmetics
(cherry picked from commit fcae3ff124ee97c9265e3b93f3d41238b2aee9bd)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

Conflicts:
	libavcodec/dsicinav.c
2013-08-24 12:17:24 +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
Luca Barbato
fbbe487b1c indeo: Sanitize ff_ivi_init_planes fail paths
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 28dda8a691f1c723a4a9365ab85f9625f1330096)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 12:11:57 +02:00
Martin Storsjö
7e9debb083 mov: Do not allow updating the time scale after it has been set
The time scale is set in mdhd, and later validated in the
enclosing trak atom once all of its children have been parsed.

A loose mdhd atom outside of a trak atom could update the time
scale of the last stream without any validation.

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 31931520df35a6f9606fe8293c8a39e2d1fabedf)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 12:11:57 +02:00
Martin Storsjö
256d615383 mov: Seek back if overreading an individual atom
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 5b4eb243bce10a3e8345401a353749e0414c54ca)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 12:11:57 +02:00
Martin Storsjö
9680f84a31 ac3dec: Don't consume more data than the actual input packet size
This was handled properly in the normal return case at the end
of the function, but not in this special case.

Returning a value larger than the input packet size can cause
problems for certain library users.

Returning the actual input buffer size unconditionally, since
it is not guaranteed that frame_size is set to a sensible
value at this point.

Cc: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 8f24c12be7a3b3ea105e67bba9a867fe210a2333)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 12:11:57 +02:00
Luca Barbato
505415b985 indeo: Reject impossible FRAMETYPE_NULL
A frame marked FRAMETYPE_NULL cannot be scalable and requires a
previous frame successfully decoded.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 5b2a29552ca09edd4646b6aa1828b32912b7ab36)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 12:11:57 +02:00
Luca Barbato
d55f7a174d indeo: Do not reference mismatched tiles
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit f9e5261cab067be7278f73d515bc9b601eb56202)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 12:11:57 +02:00
Luca Barbato
cf738340d0 indeo5: return proper error codes
(cherry picked from commit b0eeb9d442e4b7e82f6797d74245434ea33110a5)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 12:11:52 +02:00
Luca Barbato
861526bbd1 indeo: Bound-check before applying motion compensation
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 25a6666f6c07c6ac8449a63d7fbce0dfd29c54cd)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 12:09:02 +02:00
Luca Barbato
7514868cb0 indeo: Bound-check before applying transform
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit dc79685195a45c9b8b17d7b93d118e0aefa45462)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 12:09:02 +02:00
Luca Barbato
4ec5c35850 indeo4: Validate scantable dimension
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit cd78e934c246d1b2510f8fba0abfe40bb75795f6)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 12:09:02 +02:00
Luca Barbato
be71990da6 indeo4: Check the quantization matrix index
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 6255ccf7d51c82ab79bf0cd47a921f572dda4489)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 12:08:59 +02:00
Luca Barbato
99d82a07e7 indeo4: Do not access missing reference MV
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 8435bca087c0e79385763c51de009fd89390b6a5)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 12:03:47 +02:00
Martin Storsjö
96f9b18497 ac3dec: Increment channel pointers only once per channel
If the channel mapping map multiple output channels to one
input channel, we should only increment the actual pointer once.

Cc: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 68e57cde68f3da4c557ca15491fda74d1ea6321e)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 12:03:47 +02:00
Luca Barbato
c03533ace2 dca: Respect the current limits in the downmixing capabilities
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 3802833bc1f79775a1547c5e427fed6e92b77e53)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 12:03:43 +02:00
Luca Barbato
423ce8830e dca: Error out on missing DSYNC
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit f261e508459e28beca59868a878e1519a44bb678)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 11:51:26 +02:00
Luca Barbato
5e46ad33eb pcm: always use codec->id instead of codec_id
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit c82da343e635663605bd81c59d872bee3182da73)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 11:50:52 +02:00
Luca Barbato
cbc1212499 mlpdec: Do not set invalid context in read_restart_header
The faulty values rippled further down the codepath causing a
hard-to-track segfault in the assembly code.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit e9d394f3fad7e8fd8fc80e3b33cb045bbaceb446)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

Conflicts:
	libavcodec/mlpdec.c
2013-08-24 11:49:01 +02:00
Luca Barbato
64867f3cb5 pcx: Do not overread source buffer in pcx_rle_decode
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 3abde1a3b49cf299f2aae4eaae6b6cb5270bdc22)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 11:45:56 +02:00
Luca Barbato
d6a65735f9 wmavoice: conceal clearly corrupted blocks
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit d14a26edb7c4487df581f11e5c6911dc0e623d08)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 11:39:15 +02:00
Luca Barbato
c4e2758eec iff: Do not read over the source buffer
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 7d65e960c72f36b73ae7fe84f8e427d758e61da9)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 11:38:48 +02:00
Luca Barbato
9f1c3cd5ad qdm2: Conceal broken samples
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 4ecdb5ed44591aba8a0ddb7d443cace836f761f6)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 11:34:04 +02:00
Luca Barbato
160910acdb qdm2: refactor joined stereo support
qdm2 does support only two channels. Loop over the run once.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit adadc3f2443d25b375e21e801516ccfd78e0b080)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 11:33:45 +02:00
Luca Barbato
c02d4c1a98 adpcm: Write the correct number of samples for ima-dk4
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 12576afe206d35231ccd61f9033c5fdab6a11e80)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 11:33:21 +02:00
Luca Barbato
6d2a92c467 imc: Catch a division by zero
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit bbf6a4aa20bfe3d7869b2218e66063602dfb8aa7)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 11:32:58 +02:00
Luca Barbato
aa99cb15f6 atrac3: Error on impossible encoding/channel combinations
Joint stereo encoded mono is impossible.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 50cf5a7fb78846fc39b3ecdaa896a10bcd74da2a)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 11:32:37 +02:00
Luca Barbato
67a8a1c202 atrac3: set the getbits context the right buffer_end
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 22e76ec635bafdd1d1ec35581a7ac09e69e3c43e)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 11:32:26 +02:00
Luca Barbato
8f3fe7c696 atrac3: fix error handling
decode_tonal_components returns a proper AVERROR.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 874c8a17ac9b04fb7ac23d003e54e3662dd23b4e)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 11:32:15 +02:00
Luca Barbato
64bcb5d350 qdm2: check and reset dithering index per channel
Checking per subband would have the index exceed the
dithering noise table size.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 744a11c996641888d477a3981d609e79eeb69ea9)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 11:28:11 +02:00
Luca Barbato
998a0389d3 qdm2: formatting cosmetics
Apply the usual style plus drop few unnecessary return at the end
of void functions.

(cherry picked from commit 76efedeadb1f6bf79020c44a71dd0cee13d932ad)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 11:28:11 +02:00
Luca Barbato
86eec54c94 qdm2: use init_static_data
(cherry picked from commit f054e309c58894450a5d18cce9799ef58aab9f14)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 11:28:11 +02:00
Luca Barbato
e7800543fe westwood_vqa: do not free extradata on error in read_header
The extradata is already freed by avformat_open_input on
failure.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 76f5dfbfd902178df4a38221a68dc8540189345a)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 11:28:10 +02:00
Luca Barbato
fb1823e178 vqavideo: check the version
Prevent out of buffer write.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit c4abc9098cacb227dba39bac6aea16b2bceba0d0)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 11:28:07 +02:00
Michael Niedermayer
a747cf8873 rmdec: Use the AVIOContext given as parameter in rm_read_metadata()
This fixes crashes when playing back certain RealRTSP streams.

When invoked from the RTP depacketizer, the full realmedia
demuxer isn't invoked, but only certain functions from it, where
a separate AVIOContext is passed in as parameter (for the buffer
containing the data to parse). The functions called from within
those entry points should only be using that parameter, not
s->pb. In the depacketizer case, s is the RTSP context, where ->pb
is null.

Cc: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit d35b6cd3775456a23b63e73316e244b671caa02f)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 11:07:52 +02:00
Michael Niedermayer
002ca3e099 avio: Handle AVERROR_EOF in the same way as the return value 0
This makes sure the ffurl_read_complete function actually
returns the number of bytes read, as the documentation of the
function says, even if the underlying protocol uses AVERROR_EOF
instead of 0.

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

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 11:06:55 +02:00
Luca Barbato
fa6eef4210 wtv: Mark attachment with a negative stream id
A sid 0 would be mismatched to the attachment.

Prevent NULL pointer dereference.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit f5e646a00ac21e500dae4bcceded790a0fbc5246)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-24 11:06:33 +02:00
Michael Niedermayer
daa809fd9f swr/rematrix: Fix handling of AV_CH_LAYOUT_STEREO_DOWNMIX output
Fixes Ticket2859

Note, testcases related to the downmix channels are welcome.
(id like to make sure this is working correctly now, as obviously it didnt
 work before ...)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c56d4dab039b352961cca298d753b04e2f2fd990)
2013-08-20 18:45:21 +02:00
Michael Niedermayer
6124a7edbc swr: clean layouts before checking sanity
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6dfffe92004dfd8c79d18791f28a2b1c7e387845)
2013-08-20 18:45:19 +02:00
Michael Niedermayer
cb51d9ed25 movenc: ilbc needs audio_vbr set.
Without this the block_align or bitrate value is not available to the decoder

Fixes Ticket2858

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3d64845600c6486a2706b118a81805f3bf4d3db5)
2013-08-20 18:45:17 +02:00
Anton Khirnov
3f5824aa18 avconv: do not use lavfi direct rendering with -deinterlace
-deinterlace allocates a temporary buffer that is freed immediately
after the frame is sent to lavfi, which results in use after free.

Disable direct rendering when -deinterlace is used.

CC:libav-stable@libav.org
Bug-id: 479
2013-08-04 18:57:39 +02:00
Michael Niedermayer
a1ce54ce6a avcodec/kmvc: fix MV checks
Fixes Ticket2813
Fixes regression since 70b5583

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3cd8aaa2b2e78faf039691e1c31ff4f8d94e3bc6)
2013-07-31 02:58:03 +02:00
Paul B Mahol
ef81f55ec7 Revert "pnm: remove nonsense code"
Breaks decoding pgms with 255 < maxval < 65535.

Found-by: Carl Eugen Hoyos <cehoyos@ag.or.at>.

This reverts commit a0348d0966a81a66f3a1bf061576b24d5296b933.
(cherry picked from commit 768e40b451a459fefaceed6b1b3d6e70c93596ac)
2013-07-29 00:00:42 +02:00
Luca Barbato
c2c9b7297f avidec: Let the inner dv demuxer take care of discarding
(cherry picked from commit c8f0b20b4a6bb6691928789d83e4b)

CC: libav-stable@libav.org
2013-07-27 16:32:32 +02:00
Michael Niedermayer
a1ac3c2d9c avformat/dtsdec: Improve probe, reject things looking like analog signals
Fixes Ticket2810

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

Conflicts:
	libavformat/dtsdec.c
2013-07-26 12:20:52 +02:00
Michael Niedermayer
ae72abf652 avformat/matroskadec: Detect conflicting sample rate/default_duration
Fixes Ticket2508

Thanks-to: Moritz Bunkus
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6158a3bcdf52fafc1d9ae9eb358a56c614b23aa3)
2013-07-16 11:50:37 +02:00
Michael Niedermayer
9260710739 Merge remote-tracking branch 'jamrial/release/1.1' into release/1.1
* jamrial/release/1.1:
  oggparseskeleton: avoid header parsing failure
  oggparseskeleton: Replace avpriv_report_missing_feature() with a normal av_log() call
  oggparseskeleton: Fix fisbone header parsing

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-15 03:10:05 +02:00
Michael Niedermayer
b0558cd011 update all trac links to use the trac subdomain
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-15 02:34:35 +02:00
Michael Niedermayer
0f84286677 mpeg12dec: avoid reinitialization on PS changes when possible.
Fixes Ticket2574

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

Conflicts:
	libavcodec/mpeg12dec.c
2013-07-09 00:17:03 +02:00
Michael Niedermayer
18900381e2 mp3dec: detect CBR and use CBR axiom to seek
This should also work reasonable with truncated and growing mp3s.
Fixes Ticket2590

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

Conflicts:
	libavformat/mp3dec.c
2013-07-09 00:15:38 +02:00
Michael Niedermayer
944c47166d oggparseskeleton: avoid header parsing failure
Based on description by James Almer and the xiph wiki

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 9a6e814be7c052deb34a8f585176d053f4c187c1)
2013-07-07 21:40:46 -03:00
James Almer
86a816902f oggparseskeleton: Replace avpriv_report_missing_feature() with a normal av_log() call
since there should not be more than one fisbone for a given stream.

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

Conflicts:
	libavformat/oggparseskeleton.c
2013-07-07 21:40:01 -03:00
James Almer
8695d814e1 oggparseskeleton: Fix fisbone header parsing
start_granule should be applied to the stream referenced in the fisbone packet, not to the
Skeleton stream.
This was broken in d1f05dd18375f2f8e68372edee11436927e43ba8 and produced bogus warnings about
multiple fisbone in the same stream on files with more than one stream.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3960992f0abf8e28acada220c79fb754d67298ba)
2013-07-07 21:38:49 -03:00
Michael Niedermayer
ce74b92c09 mmsh: dont close context on seeking failure
Fixes Ticket2581

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b4579a29c75e2968ede2ad002dd4a495dbfc883d)
2013-07-07 21:38:48 +02:00
Michael Niedermayer
ba8d684622 avformat/mov: Fix duration of fragmented mov
Fixes Ticket2757

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit dc2a13aa802fc691c25d5e0194818831058316ee)
2013-07-07 18:37:12 +02:00
Michael Niedermayer
25ed0f05fd libavcodec/x86/mpegvideo: Move mmx functions under HAVE_MMX_INLINE
should fix ticket2755

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 707b2135fda3687a6eeb91411f801e437f633f30)
2013-07-07 18:36:43 +02:00
Michael Niedermayer
b186a5d08c mpegts: only reopen pmt_cb filter if its different from the previous.
Fixes Ticket2632

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b009267910df10c004b5f340a090d45da29089a0)
2013-07-07 18:33:32 +02:00
Michael Niedermayer
af95e174c5 rmdec: Pass AVIOContext to rm_read_metadata()
Fix null pointer dereference
Fixes Ticket2588

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit bf87908cd8da31e8f8fe75c06577170928ea70a8)
2013-07-07 18:32:50 +02:00
Michael Niedermayer
93fc80f8bf avcodec/x86/dsputil_init: only use xvid idct for lowres=0
Fixes crash
Fixes Ticket2714

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

Conflicts:
	libavcodec/x86/dsputil_init.c
2013-07-07 18:32:15 +02:00
Reinhard Tartler
9aaca159bd Update Changelog 2013-07-06 15:06:47 +02:00
Luca Barbato
258eea3f2e kmvc: Clip pixel position to valid range
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 4e7f0b082d8c4b360312216b9241bec65ff63b35)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-07-06 15:06:31 +02:00
Luca Barbato
1c2bd6fe5f kmvc: use fixed sized arrays in the context
Avoid some boilerplate code to dynamically allocate and then free the
buffers.
(cherry picked from commit 8f689770548c86151071ef976cf9b6998ba21c2a)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>

Conflicts:
	libavcodec/kmvc.c
2013-07-06 15:06:31 +02:00
Luca Barbato
73d5d7acb0 indeo: reject negative array indexes
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org

(cherry picked from commit 6a10142faa1cca8ba2bfe51b970754f62d60f320)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-06 15:06:31 +02:00
Luca Barbato
80d73b4ada indeo: Cosmetic formatting
Trim some overly long lines.

(cherry picked from commit 6dfacd7ab126aea1392949d1aa10fdc3d3eeb911)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-06 15:06:31 +02:00
Luca Barbato
b9892e1813 indeo: Refactor ff_ivi_init_tiles and ivi_decode_blocks
Spin large and mostly self contained blocks into stand alone
functions.

(cherry picked from commit 62256010e9bc8879e2bf7f3b94af8ff85e239082)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-06 15:06:31 +02:00
Luca Barbato
d76480e6ba indeo: Refactor ff_ivi_dec_huff_desc
Spare an indentation level.

(cherry picked from commit f6f36ca8ca1b2526d3abff7d7c627322d3bce912)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-06 15:06:31 +02:00
Luca Barbato
33388299fb indeo: use a typedef for the mc function pointer
(cherry picked from commit e6d8acf6a8fba4743eb56eabe72a741d1bbee3cb)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-07-06 15:06:31 +02:00
Luca Barbato
d8dab6c3b8 indeo: use proper error code
(cherry picked from commit dd3754a48854cd570d38db72394491aab0f36570)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-07-06 15:06:31 +02:00
Reinhard Tartler
c8fb5d0f38 Update Changelog 2013-07-06 13:20:57 +02:00
Luca Barbato
5f7944a308 indeo: check for reference when inheriting mvs
The same is done already for qdelta.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit b36e1893ef3430f039c1eaddeedcbb378f9c4444)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-07-04 22:06:13 +02:00
Luca Barbato
f518fa6bee indeo: use proper error code
(cherry picked from commit dd3754a48854cd570d38db72394491aab0f36570)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-07-04 22:05:48 +02:00
Luca Barbato
51a23b0e95 indeo: Properly forward the error codes
If the tile data size does not match the buffer size it did not
return an AVERROR_INVALIDDATA causing futher corruption later.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 7388c0c58601477db076e2e74e8b11f8a644384a)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-07-04 22:05:15 +02:00
Reinhard Tartler
5c54fc6195 Prepare for 9.8 RELEASE 2013-06-30 16:03:27 +02:00
Luca Barbato
2cdc976320 mjpeg: Check the unescaped size for overflows
And contextually check init_get_bits success and fix the reporting
message.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 6765ee7b9cba46818a45b051438b2552f0a1b70a)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>

Conflicts:
	libavcodec/mjpegdec.c
2013-06-30 16:03:27 +02:00
Luca Barbato
efcfd50c9f wmapro: error out on impossible scale factor offsets
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 02ec656af72030eea4f3d63e30b25625cce6a3df)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-06-30 16:03:27 +02:00
Luca Barbato
8bd0372937 wmapro: check the min_samples_per_subframe
Must be at least WMAPRO_BLOCK_MIN_SIZE.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit d4a217a408da4bd63acc02cd8f9ebe378a2ad65a)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-06-30 16:03:27 +02:00
Luca Barbato
9761abffb6 wmapro: return early on unsupported condition
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 6652338f43ef623045912d7f28b61adea05d27ae)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>

Conflicts:
	libavcodec/wmaprodec.c
2013-06-30 16:03:27 +02:00
Luca Barbato
fbeae4a951 wmapro: check num_vec_coeffs against the actual available buffer
Prevent yet another buffer overwrite.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 38229362529ed1619d8ebcc81ecde85b23b45895)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-06-30 16:03:27 +02:00
Luca Barbato
88433979c2 wmapro: make sure there is room to store the current packet
Prevent horrid and hard to trace struct overwrite.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit e30b068ef79f604ff439418da07f7e2efd01d4ea)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-06-30 16:03:27 +02:00
Luca Barbato
9d1b173aae lavc: move put_bits_left in put_bits.h
(cherry picked from commit afe03092dd693d025d43e1620283d8d285c92772)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-06-30 16:03:27 +02:00
Luca Barbato
c7934c6c0b 4xm: do not overread the source buffer in decode_p_block
Check for out of picture macroblocks before calling mcdc.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 94aefb1932be882fd93f66cf790ceb19ff575c19)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-06-30 16:03:27 +02:00
Luca Barbato
04c29196ad 4xm: check bitstream_size boundary before using it
Prevent buffer overread.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 59d7bb99b6a963b7e11c637228b2203adf535eee)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-06-30 16:03:27 +02:00
Nigel Touati-Evans
e2dcc4452d Fix copying extradata to codec in mxfdec.c
The code that copies any extradata from the MXFDescriptor to the codec does
not set the size, which it should otherwise the copied data is useless.

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

Conflicts:
	libavformat/mxfdec.c
2013-06-27 14:20:11 +02:00
Hendrik Leppkes
24dc6b1a06 mathops/x86: work around inline asm miscompilation with GCC 4.8.1
The volatile is not required here, and prevents a miscompilation with GCC
4.8.1 when building on x86 with --cpu=i686

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 659df32a9d8984081ccd54adc3aee7daeb33388d)
2013-06-24 08:45:50 +02:00
Michael Niedermayer
d8e76a531c avdevice/x11grab: allocate just one Cursor
Fixes resource leak and Ticket2450

Reviewed-by: Carl Eugen Hoyos <cehoyos@ag.or.at>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1ee8fadb811f3b1ef370c7d6c7bf62088f1cc954)
2013-06-21 17:19:00 +02:00
Michael Niedermayer
2cfdf732ef avformat/libmodplug: Reduce the probe score for small input
This ensures that theres enough data for mpeg_probe() to recognize mpeg-ps
Fixes Ticket2583

Based on code by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c605adbf562fbf535e83ae427bb681bc45e440c8)
2013-06-21 01:14:27 +02:00
Carl Eugen Hoyos
8268c1fea8 Autodetect idcin only if audio properties allow decoding.
Fixes ticket #2688.
(cherry picked from commit 06bede95fcea47d2e51e8ff248c15311f335b898)
2013-06-19 23:46:09 +02:00
Michael Niedermayer
d9a91dfb54 swresample/x86/audio_convert: add emms to CONV
Fixes ticket #1874

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ca2818b88155029bb6f989ee522e7f8e9e9f5927)
2013-06-18 02:53:51 +02:00
Reinhard Tartler
5d2e4c918f update Changelog 2013-06-16 19:32:07 +02:00
Kostya Shishkov
7e326d52a7 smacker: check frame size validity
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org

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

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-06-16 15:58:29 +02:00
Kostya Shishkov
71b8ef938c smacker: pad the extradata allocation
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org

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

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-06-16 15:58:27 +02:00
Kostya Shishkov
5e6122ddad smacker: check the return value of smacker_decode_tree
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org

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

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-06-16 15:58:26 +02:00
Kostya Shishkov
1a0cdd18b0 smacker: fix an off by one in huff.length computation
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org

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

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-06-16 15:58:22 +02:00
Luca Barbato
d33b0f7224 4xm: do not overread the prestream buffer
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit be373cb50d3c411366fec7eef2eb3681abe48f96)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-06-16 15:54:23 +02:00
Luca Barbato
6ddc1eb037 4xm: validate the buffer size before parsing it
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit de2e5777e225e75813daf2373c95e223651fd89a)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-06-16 15:54:15 +02:00
Luca Barbato
ded74ab5d1 4xm: reject frames not compatible with the declared version
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 145023f57262d21474e35b4a6069cf95136339d4)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-06-16 15:54:06 +02:00
Luca Barbato
f82e9deec2 4xm: drop pointless assert
Make sure the value of wlog2 is always between 0 and 3.
(cherry picked from commit 1f0c6075604c271d5627480f1243d22795f9a315)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-06-16 15:53:55 +02:00
Luca Barbato
d0cabcc789 4xm: forward errors from decode_p_block
Partially mitigate out of memory writes.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit b8b809908ec547b2609dbac24194f4fd2df61aea)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-06-16 15:53:44 +02:00
Luca Barbato
dac0d4f354 4xm: fold last_picture lazy allocation in decode_p_frame
(cherry picked from commit 50ec1db62d977b6e864f315a53c1c580a6d7efa4)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

Conflicts:
	libavcodec/4xm.c
2013-06-16 15:53:33 +02:00
Luca Barbato
3f71c0c1b0 4xm: do not overread while parsing header
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 42d73f7f6bea0ee0f64a3ad4882860ce5b923a11)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-06-16 15:53:18 +02:00
Luca Barbato
ea56f6e5a7 4xm: refactor fourxm_read_header
Split sound and video tag parsing in separate functions.
(cherry picked from commit e7a44f87d07655ec0cd31c315936931674434340)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

Conflicts:
	libavcodec/4xm.c
2013-06-16 15:53:04 +02:00
Luca Barbato
9ac3c6c2c6 4xm: K&R formatting cosmetics
(cherry picked from commit e6496ea7e7ea7355167a1ccbe67a7199d446a654)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-06-16 15:15:18 +02:00
Luca Barbato
04c506e912 4xm: use the correct logging context
(cherry picked from commit 08859d19b429c522d6494c186656f4a2d3ff8e21)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-06-16 15:15:11 +02:00
Michael Niedermayer
bc4dc32b2a alacenc: Fix missing sign_extend()
Fixes ticket #2497

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8aea2f05dc56f7e7d60767dd27ba8e846a05e8ae)
2013-06-13 00:04:23 +02:00
Michael Niedermayer
01580c0955 Merge remote-tracking branch 'qatar/release/9' into release/1.1
* qatar/release/9:
  tiff: do not overread the source buffer
  apetag: use int64_t for filesize

Conflicts:
	libavcodec/tiff.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-06-09 11:06:28 +02:00
Luca Barbato
8eb7c2566c tiff: do not overread the source buffer
At least 2 bytes from the source are read every loop.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 9c2216976907336dfae0e8e38a4d70ca2465a92c)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>

Conflicts:
	libavcodec/tiff.c
2013-06-08 16:31:54 +02:00
Anton Khirnov
042b8c2f06 apetag: use int64_t for filesize
CC: libav-stable@libav.org
(cherry picked from commit e816aaacd68201b67182f9c70dc680e89a0123e9)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-06-08 16:31:54 +02:00
Michael Niedermayer
2fae70db2a vmdav: Try to fix unpack_rle()
This fixes out of array accesses
The code prior to this commit could not have worked, thus obviously
was untested. I was also not able to find a valid sample that uses this
code.
This fix is thus only based on the description of the format

If someone has a sample that uses unpack_rle(), please mail me.

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

Conflicts:

	libavcodec/vmdav.c

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-06-03 02:34:10 +02:00
Michael Niedermayer
f08b0ff051 Merge remote-tracking branch 'qatar/release/9' into release/1.1
* qatar/release/9:
  vmd: refactor the inner decode loop

Conflicts:
	libavcodec/vmdav.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-06-03 02:21:38 +02:00
Michael Niedermayer
f86b2e4f49 Merge commit '5a01ab0e62c95a60b4848744e623640f5dafe23b' into release/1.1
* commit '5a01ab0e62c95a60b4848744e623640f5dafe23b':
  vmd: use the PALETTE_COUNT constant uniformly

Conflicts:
	libavcodec/vmdav.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-06-03 02:11:04 +02:00
Michael Niedermayer
d6373f1586 Merge commit 'dbaf3f7b0bc9e99dff8e06bd29fcb3e84eebfe7c' into release/1.1
* commit 'dbaf3f7b0bc9e99dff8e06bd29fcb3e84eebfe7c':
  vmd: drop incomplete chunks and spurious samples
  vmd: return meaningful errors

Conflicts:
	libavcodec/vmdav.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-06-03 01:57:01 +02:00
Michael Niedermayer
2a39548181 Merge commit '4f6fbe47a9f784373c277870d9d4989762873bf1' into release/1.1
* commit '4f6fbe47a9f784373c277870d9d4989762873bf1':
  vmdav: convert to bytestream2

Conflicts:
	libavcodec/vmdav.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-06-03 01:32:19 +02:00
Michael Niedermayer
4c052a7b8b Merge commit '7251de30322aff5660e571856132dc6c7256fe94' into release/1.1
* commit '7251de30322aff5660e571856132dc6c7256fe94':
  wavpack: use bytestream2 in wavpack_decode_block

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-06-03 01:09:23 +02:00
Michael Niedermayer
30394adc44 Merge commit '5ba83e90919cdeef38e2b5343b48f3f367292564' into release/1.1
* commit '5ba83e90919cdeef38e2b5343b48f3f367292564':
  wavpack: return meaningful errors

Conflicts:
	libavcodec/wavpack.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-06-03 00:57:23 +02:00
Michael Niedermayer
f908e3ce92 Merge commit '93fbf034c94caf7ddfecd3c1947e3139fef6bfca' into release/1.1
* commit '93fbf034c94caf7ddfecd3c1947e3139fef6bfca':
  wavpack: check packet size early

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-06-03 00:52:17 +02:00
Michael Niedermayer
683cbbb721 Merge commit '10f77c165c3b3e881bb174a0f57dd62083639072' into release/1.1
* commit '10f77c165c3b3e881bb174a0f57dd62083639072':
  pixdesc: mark gray8 as pseudopal
  mjpegdec: validate parameters in mjpeg_decode_scan_progressive_ac
  mjpeg: Validate sampling factors
  ljpeg: use the correct number of components in yuv
  wavpack: validate samples size parsed in wavpack_decode_block

Conflicts:
	libavcodec/mjpegdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-06-03 00:40:23 +02:00
Michael Niedermayer
cff8d01e15 Merge commit '0af5a774ebc96ae9018926dc8b276c7f39767e3e' into release/1.1
* commit '0af5a774ebc96ae9018926dc8b276c7f39767e3e':
  jpegls: check the scan offset
  jpegls: factorize return paths
  jpegls: return meaningful errors
  mpegvideo: allocate sufficiently large scratch buffer for interlaced vid

Conflicts:
	libavcodec/jpeglsdec.c
	libavcodec/mpegvideo.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-06-03 00:16:52 +02:00
Michael Niedermayer
8c118207ea Merge commit 'aaeef7fa0d6ebb1a3668894e67a70cd5084ce4f4' into release/1.1
* commit 'aaeef7fa0d6ebb1a3668894e67a70cd5084ce4f4':
  mjpegdec: properly report unsupported disabled features
  Prepare for 9.7 Release
  update Changelog
  proresdec: support mixed interlaced/non-interlaced content

Conflicts:
	RELEASE
	libavcodec/mjpegdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-06-03 00:06:22 +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
Claudio Freire
c320f9f5e9 AAC encoder: Fix rate control on twoloop.
Fixes a case where multichannel bitrate isn't accurately
targetted by psy model alone, never achieving the target bitrate.
Now fixed.

Fixes ticket #2625.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Carl Eugen Hoyos <cehoyos@ag.or.at>
2013-06-02 16:26:36 +02:00
Luca Barbato
5fed47b94f vmd: refactor the inner decode loop
Simplify a little, assume empty frames are acceptable and
do not pointlessly reinit the bytestream2 contexts using
possibly wrong size values.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 676da248cad49debc40720baa13214f0b94dcc71)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

Conflicts:
	libavcodec/vmdav.c
2013-06-01 15:28:19 +02:00
Luca Barbato
5a01ab0e62 vmd: use the PALETTE_COUNT constant uniformly
While at it drop useless parentheses.
(cherry picked from commit 91a6944e56236234f0a7ba162404665753cbcb51)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-06-01 05:38:38 +02:00
Luca Barbato
dbaf3f7b0b vmd: drop incomplete chunks and spurious samples
Odd chunk size makes no sense for stereo and incomplete chunks are
not supported.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 701966730ce10290fd49c5ccedd73f505680f764)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-05-31 23:14:01 +02:00
Alexandra Khirnova
4f6fbe47a9 vmdav: convert to bytestream2
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 0afcf97e1ece51d29bb791698b00cd1b7ba97dcf)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>

Conflicts:
	libavcodec/vmdav.c
2013-05-31 23:00:31 +02:00
Luca Barbato
7251de3032 wavpack: use bytestream2 in wavpack_decode_block
Prevent most out of buffer reads.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 3f0b6d7a6248a33df37b98cfcb37a1acce263f62)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>

Conflicts:
	libavcodec/wavpack.c
2013-05-31 23:00:31 +02:00
Luca Barbato
5ba83e9091 wavpack: return meaningful errors
And forward those that were already meaningful.
(cherry picked from commit 8c34558131d846d2b10389564caadaa206372fd4)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>

Conflicts:
	libavcodec/wavpack.c
2013-05-31 23:00:31 +02:00
Luca Barbato
93fbf034c9 wavpack: check packet size early
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit fd06291239c1bb616bf303b5696cc432710b2530)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-05-31 23:00:31 +02:00
Anton Khirnov
10f77c165c pixdesc: mark gray8 as pseudopal
Many functions treat it as such already.
Fixes Bug 499.

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-05-31 23:00:31 +02:00
Luca Barbato
5a8dcc993d vmd: return meaningful errors
CC: libav-stable@libav.org
(cherry picked from commit c8f3cb9119c2183680d44a509a1b5a9817a3bee9)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>

Conflicts:
	libavcodec/vmdav.c
2013-05-31 23:00:31 +02:00
Luca Barbato
aed12df7fe mjpegdec: validate parameters in mjpeg_decode_scan_progressive_ac
Prevent out of buffer write when decoding broken samples.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit cfbd98abe82cfcb9984a18d08697251b72b110c8)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-05-31 23:00:31 +02:00
Luca Barbato
7923a25fdd mjpeg: Validate sampling factors
They must be non-zero.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 8aa3500905fec6c4e657bb291b861d43c34d3de9)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-05-31 23:00:31 +02:00
Luca Barbato
510a96a211 ljpeg: use the correct number of components in yuv
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit a030279a67ef883df8cf3707774656fa1be81078)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-05-31 23:00:31 +02:00
Luca Barbato
0af5a774eb jpegls: check the scan offset
Prevent an out of array bound write.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit abad374909e6416e941351094f4f1446a71f8d23)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>

Conflicts:
	libavcodec/jpeglsdec.c
2013-05-31 23:00:30 +02:00
Luca Barbato
aaeef7fa0d mjpegdec: properly report unsupported disabled features
When JPEG-LS support is disabled the decoder would feed the
data to the JPEG Lossless decode_*_scan function resulting in
faulty decoding.

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-05-31 23:00:30 +02:00
Luca Barbato
c340319559 wavpack: validate samples size parsed in wavpack_decode_block
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit ed50673066956d6f2201a57c3254569f2ab08d9d)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>

Conflicts:
	libavcodec/wavpack.c
2013-05-31 23:00:30 +02:00
Reinhard Tartler
582aec4989 jpegls: factorize return paths
Conflicts:
	libavcodec/jpeglsdec.c

(cherry picked from commit 4a4107b48944397c914aa39ee16a82fe44db8c4c)
2013-05-31 23:00:30 +02:00
Reinhard Tartler
2c23237cb4 Prepare for 9.7 Release 2013-05-31 23:00:30 +02:00
Luca Barbato
9eecf633f7 jpegls: return meaningful errors
(cherry picked from commit a5a0ef5e13a59ff53318a45d77c5624b23229c6f)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>

Conflicts:
	libavcodec/jpeglsdec.c
2013-05-31 23:00:30 +02:00
Jindrich Makovicka
7f451cb01f mpegvideo: allocate sufficiently large scratch buffer for interlaced vid
MPV_decode_mb_internal needs 3 * 16 * linesize bytes of scratch buffer

For interlaced content, linesize is multiplied by two after the allocation
of the scratch buffer, and the dest_cr pointer ends past the buffer.

This patch makes ff_mpv_frame_size_alloc allocate a total of
(aligned line_size) * 2 * 16 * 3 bytes, which suffices even for the
interlaced case.

CC:libav-stable@libav.org

Signed-off-by: Jindrich Makovicka <makovick@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 259af1b92370b32f6d0b9a6de314db4b44c2481d)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-05-31 23:00:30 +02:00
Michael Niedermayer
a987750267 h264_cavlc: fix reading skip run
Fixes Ticket2606

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

Conflicts:
	libavcodec/h264_cavlc.c
2013-05-30 22:35:21 +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
414c6bf094 avienc: Disallow the first frame to be skiped
Fixes Ticket2386

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cc0db8cf3042186d8355dcf10be67071cfbbcc5d)
2013-05-27 23:52:26 +02:00
Michael Niedermayer
6f585f1e66 smacker: remove av_clip_int16()
Fixes Ticket2425

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2211c76287e073a9e176fde7dbb9a63ceb2af8d1)
2013-05-20 23:59:09 +02:00
Michael Niedermayer
85277ff936 ffmpeg: free threads on error conditions.
Fixes Ticket2562

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1a36c756d8959207d3386f03e11c15216abc50b7)
2013-05-17 23:23:57 +02:00
Michael Niedermayer
f544553c29 avidec: dont randomly skip packets for offseting the index
Fixes Ticket2490

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6c593f1b671b7725b8c36f92f7c0a23ccf8e7628)
2013-05-17 22:53:19 +02:00
Carl Eugen Hoyos
51ee51b5eb Do not read strd chunk in avi files as H264 extradata.
Fixes ticket #2561.
(cherry picked from commit 231b3317184790b6be4b4619d96fd328f13aeabb)
2013-05-13 14:38:15 +02:00
Michael Niedermayer
2e00dd4d62 Update for 1.1.5
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-13 00:59:36 +02:00
Michael Niedermayer
91138821fb gifdec: check that the last keyframe exists and has been successfully parsed.
Prevents inconsistent state and null pointer dereference

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

Conflicts:

	libavcodec/gifdec.c

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-13 00:58:49 +02:00
Michael Niedermayer
a4681d1043 gifdec: reset previous Graphic Control Extension disposal type
This fixes out of array accesses.

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

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

Conflicts:

	libavcodec/gifdec.c

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-13 00:46:27 +02:00
Michael Niedermayer
151c2ca8c7 avcodec/cdgraphics: check buffer size before use
Fixes out of array accesses

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-13 00:45:21 +02:00
Michael Niedermayer
dafd8228bc sanm: Check dimensions before use
Fixes integer overflow and out of array accesses

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-13 00:45:16 +02:00
Clément Bœsch
d9ab7c6292 cmdutils: avtool -> fftool
(cherry picked from commit 7d8ad6c1fa11ec548fc63427656989e0e7c6af8b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-13 00:45:09 +02:00
Michael Niedermayer
426715ccbd avutil/intfloat_readwrite: include common.h for isinf()
Solution based on rational.c, which uses isinf() too

This should fix compilation with msvc

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-13 00:45:02 +02:00
Michael Niedermayer
a4e3bb0106 avutil/intfloat_readwrite: avoid comparission with INFINITY, use isinf()
Should fix pgc warning

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-13 00:44:56 +02:00
Michael Niedermayer
cd2d8aca84 avutil/log: Fix context pointer used for get_category()
Fixes calling a random pointer

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-13 00:44:52 +02:00
Michael Niedermayer
e9d9fd1137 vmdav: Try to fix unpack_rle()
This fixes out of array accesses
The code prior to this commit could not have worked, thus obviously
was untested. I was also not able to find a valid sample that uses this
code.
This fix is thus only based on the description of the format

If someone has a sample that uses unpack_rle(), please mail me.

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

Conflicts:

	libavcodec/vmdav.c

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-13 00:44:44 +02:00
Michael Niedermayer
e4bae0a140 mmvideo/mm_decode_intra: check horizontal coordinate too
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ae2132ac90f02330b0988e6e26ee0d53e41cd196)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-13 00:44:27 +02:00
Michael Niedermayer
520c3d2303 mmvideo/mm_decode_inter: check horizontal coordinate too
Fixes out of array accesses

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-13 00:44:22 +02:00
Michael Niedermayer
82a627c2c3 mjpegdec: fix overlapping memcpy with upscale_v
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b39fd7d63648442c20671c3e4b357268ec5c49f2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-13 00:44:12 +02:00
Michael Niedermayer
0cb4887b83 avcodec/mpegvideo: Fix edge emu with lowres
Fixes a few green artifacts at the top
Fixes rest of Ticket 2535

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-13 00:43:04 +02:00
Michael Niedermayer
4a45535836 avcodec/mpegvideo: Fix block height for lowres 3 interlaced blocks
Fixes green trash
Fixes part of Ticket2535

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-13 00:42:33 +02:00
Michael Niedermayer
4427e96bb1 src_movie: fix scanf string
Fixes out of array accesses

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-13 00:35:04 +02:00
Michael Niedermayer
731f4bb6fd xbmdec: fix off by one error in scanf()
Fixes out of array access

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-13 00:35:04 +02:00
Michael Niedermayer
898ce4d6e2 Merge remote-tracking branch 'qatar/release/9' into release/1.1
* qatar/release/9:
  update Changelog
  af_asyncts: fix offset calculation
  oma: properly forward errors in oma_read_packet
  indeo3: use unaligned reads on reference blocks.

Conflicts:
	Changelog

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-12 14:39:09 +02:00
Michael Niedermayer
93f80cf2cc Merge commit '1ab4578c88dc3e1407da15471bd323ba40c3ebbb' into release/1.1
* commit '1ab4578c88dc3e1407da15471bd323ba40c3ebbb':
  lavc: Fix assignments in if() when calling ff_af_queue_add
  wav: Always seek to an even offset
  swscale: Use alpha from the right row in yuva2rgba_c
  Prepare for 9.6 Release

Conflicts:
	RELEASE

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-12 14:31:59 +02:00
Michael Niedermayer
204c8798a8 Merge commit '0662967d2bbdbe90540eaa8c847f521fa4b75aab' into release/1.1
* commit '0662967d2bbdbe90540eaa8c847f521fa4b75aab':
  hls, segment: fix splitting for audio-only streams.
  afifo: fix request_samples on the last frame in certain cases
  id3v2: check for end of file while unescaping tags
  indeo3: fix off by one in MV validity check

Conflicts:
	libavformat/id3v2.c
	libavformat/segment.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-12 14:25:50 +02:00
Michael Niedermayer
9767d7513c Merge commit '46fd6e4f2ebbcd5a00847cdb05fe416466d06d37' into release/1.1
* commit '46fd6e4f2ebbcd5a00847cdb05fe416466d06d37':
  aac: check the maximum number of channels
  update Changelog
  riff: check for eof if chunk size and code are 0
  oggdec: fix faulty cleanup prototype

Conflicts:
	Changelog

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-12 14:11:03 +02:00
Michael Niedermayer
d2b9da2f37 Merge commit 'c8462bd17f35f435192281a2ea4ce8008a7398d3' into release/1.1
* commit 'c8462bd17f35f435192281a2ea4ce8008a7398d3':
  mp3dec: fallback to generic seeking when a TOC is not present
  svq1dec: clip motion vectors to the frame size.
  svq1dec: check that the reference frame has the same dimensions as the current one
  qdm2: check that the FFT size is a power of 2

Conflicts:
	libavcodec/svq1dec.c
	libavformat/mp3dec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-12 13:55:06 +02:00
Michael Niedermayer
395538e073 Merge commit '95db1624ef98ccc4ba7ff70d50c4b4d0f8ffed54' into release/1.1
* commit '95db1624ef98ccc4ba7ff70d50c4b4d0f8ffed54':
  indeo3: switch parsing the header to bytestream2
  indeo3: check motion vectors.
  rv10: check that extradata is large enough
  indeo3: fix data size check

Conflicts:
	libavcodec/indeo3.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-12 13:44:08 +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
Michael Niedermayer
63235b8d41 Merge commit '858864d350320dd807e349bda017026e61a47fe0' into release/1.1
* commit '858864d350320dd807e349bda017026e61a47fe0':
  xmv: check audio track parameters validity.
  bmv: check for len being valid in bmv_decode_frame().
  xmv: do not leak memory in the error paths in xmv_read_header()
  matroska: pass the lace size to the matroska_parse_rm_audio

Conflicts:
	libavformat/matroskadec.c
	libavformat/xmv.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-12 13:19:54 +02:00
Michael Niedermayer
5353bd0285 Merge commit 'b90816d94b0b5c01f451ff98cfbf1d5ddec9c3c1' into release/1.1
* commit 'b90816d94b0b5c01f451ff98cfbf1d5ddec9c3c1':
  matroska: Update the available size after lace parsing

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-12 13:09:24 +02:00
Michael Niedermayer
065996b984 Merge commit '05015d03da1d745bb92915b5cea92dec16af719f' into release/1.1
* commit '05015d03da1d745bb92915b5cea92dec16af719f':
  matroska: fix a corner case in ebml-lace parsing
  avfiltergraph: check for sws opts being non-NULL before using them.
  configure: Enable hwaccels without external dependencies by default.
  oma: Validate sample rates

Conflicts:
	libavfilter/avfiltergraph.c
	libavfilter/graphparser.c
	libavformat/oma.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-12 12:49:36 +02:00
Michael Niedermayer
1ace588f4a Merge commit 'fc6825ebb6585138e8ee2bb3484a04542c5d8b6a' into release/1.1
* commit 'fc6825ebb6585138e8ee2bb3484a04542c5d8b6a':
  vp8: Fix pthread_cond and pthread_mutex leaks
  configure: Refactor dxva2api.h dependency declarations
  flvdec: read audio sample size and channels metadata
  flvdec: use the correct audio codec id when parsing metadata

Conflicts:
	configure

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-12 12:41:03 +02:00
Michael Niedermayer
50a3442120 Merge commit '2e06758479650f6e2a8820c7105f2d193a701175' into release/1.1
* commit '2e06758479650f6e2a8820c7105f2d193a701175':
  Prepare for 9.5 Release
  update Changelog
  add missed CVE reference in 9.2 release
  fate: fetch samples that match the release series

Conflicts:
	Changelog
	RELEASE
	tests/Makefile

The rsync change is not merged
We need to maintain the ability to checkout and test old revissions
from master. This implies that the default sample repository has the
needed samples for both older and newer revissions. Thus there is no
need for a seperate one for each release.
Comments & Suggestions of course welcome

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-12 12:13:09 +02:00
Michael Niedermayer
008ae91bcc Merge commit '31a77177ff323ef83944c60a8654891213ab6691' into release/1.1
* commit '31a77177ff323ef83944c60a8654891213ab6691':
  iff: validate CMAP palette size

Conflicts:
	libavformat/iff.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-12 11:21:41 +02:00
Reinhard Tartler
82c3792a30 update Changelog 2013-05-12 08:39:07 +02:00
Michael Smith
1fa37f2bfa proresdec: support mixed interlaced/non-interlaced content
Set interlaced to false if we don't have an interlaced frame

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-05-12 08:38:36 +02:00
Reinhard Tartler
d2d38531d6 update Changelog 2013-05-11 12:00:54 +02:00
Anton Khirnov
600bc1deba af_asyncts: fix offset calculation
delta is in samples, not bytes. Also the sample format is not guaranteed
to be planar.

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-05-11 12:00:54 +02:00
Luca Barbato
77a2f4cbcf oma: properly forward errors in oma_read_packet
Prevent spurios EIO on EOF.

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-05-11 12:00:54 +02:00
Anton Khirnov
7f8b55b560 indeo3: use unaligned reads on reference blocks.
They are not guaranteed to be aligned.
Fixes Bug 503.

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-05-11 12:00:54 +02:00
Michael Niedermayer
1ab4578c88 lavc: Fix assignments in if() when calling ff_af_queue_add
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 1d7ffd06e41e44d8932d0dd62caa2da17947d8c4)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-05-08 19:05:21 +02:00
Luca Barbato
52ab9e8984 wav: Always seek to an even offset
RIFF chunks are aligned to 16bit according to the specification.

Bug-Id:500
CC:libav-stable@libav.org
(cherry picked from commit ac87eaf856e0fb51917266b899bb15d19b907baf)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-05-07 21:32:09 +02:00
Reimar Döffinger
2922ab7e6f matroska: set "done" only during resync fail.
Fixes playback of test7.mkv validation test file.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
(cherry picked from commit 762d4335aec2e5299a06bfbce15d21336af19464)
2013-05-07 10:55:11 +02:00
Martin Storsjö
5772cbb343 swscale: Use alpha from the right row in yuva2rgba_c
Every other pixel had the alpha channel taken from the wrong
row.

This fixes bug 504.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 6e293d111fcad27d52a2ef5ad77b1009f1743396)

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-05-06 17:44:24 +03:00
Carl Eugen Hoyos
46e1d05991 Fix type of shared flac table ff_flac_blocksize_table[].
Fixes ticket #2533.
(cherry picked from commit a07ac1f7888fd08e42da2bed0421e74f1cfac177)
2013-05-05 20:39:53 +02:00
Reinhard Tartler
a6f7fc8f3b Prepare for 9.6 Release 2013-05-04 10:54:29 +02:00
Anton Khirnov
0662967d2b hls, segment: fix splitting for audio-only streams.
CC:libav-stable@libav.org
(cherry picked from commit cf679b9476727a237c8006c685ace18acba149ab)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-05-04 10:53:18 +02:00
Anton Khirnov
ddeb6eeeb1 afifo: fix request_samples on the last frame in certain cases
The current code can fail to return the last frame if it contains
exactly the requested number of samples.

Fixes the join filter test, which previously did not include the last
408 samples in most cases.

CC:libav-stable@libav.org

Signed-off-by: Diego Biurrun <diego@biurrun.de>
(cherry picked from commit 9bfc6e02bae9de354fb9ba09a8a140e83eeadf7d)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>

Conflicts:
	libavfilter/fifo.c
	tests/fate/filter-audio.mak
2013-05-04 10:44:51 +02:00
Luca Barbato
5aac081110 id3v2: check for end of file while unescaping tags
Prevent an out of buffer bound write.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
(cherry picked from commit af4cc2605c7a56ecfd84c264aa2b325020418472)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-05-03 19:22:07 +02:00
Anton Khirnov
d8745de6ae indeo3: fix off by one in MV validity check
CC:libav-stable@libav.org
(cherry picked from commit 95220be1faac628d849a004644c0d102df0aa98b)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-05-03 19:21:45 +02:00
Luca Barbato
46fd6e4f2e aac: check the maximum number of channels
Broken bitstreams could report a larger than specified number of
channels and cause outbound writes.

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

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-04-28 00:43:43 +02:00
Reinhard Tartler
6cad940989 update Changelog 2013-04-21 22:46:41 +02:00
Luca Barbato
c046890191 riff: check for eof if chunk size and code are 0
Prevent an infinite loop.

Inspired by a patch from Michael Niedermayer

CC: libav-stable@libav.org

Signed-off-by: Diego Biurrun <diego@biurrun.de>
(cherry picked from commit 8e329dba378cef0ff6400c7df9c51da167d5a1f0)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-04-21 22:46:41 +02:00
Luca Barbato
d70bad04de oggdec: fix faulty cleanup prototype
(cherry picked from commit fba8e5b608577fc660989d0057a55818254a3744)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-04-21 18:51:25 +02:00
Michael Niedermayer
c8462bd17f mp3dec: fallback to generic seeking when a TOC is not present
Fixes seeking without a Xing/Info header.

CC: libav-stable@libav.org
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 505642f18276aed03278ac91b1f334ea888eac6a)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-04-19 20:26:56 +02:00
Anton Khirnov
a3410b5a1f svq1dec: clip motion vectors to the frame size.
Fixes invalid reads for corrupted files.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
(cherry picked from commit ecff5acb5a738fcb4f9e206a12070dac4bf259b3)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-04-18 22:06:09 +02:00
Anton Khirnov
43039f9386 svq1dec: check that the reference frame has the same dimensions as the current one
They can be different if the last keyframe failed to decode correctly.
Fixes possible invalid reads in such a case.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
(cherry picked from commit b1bb8fb860b47e90dd67f0c5740698128fc82dcc)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-04-18 22:05:55 +02:00
Anton Khirnov
d0c4d61c8b qdm2: check that the FFT size is a power of 2
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
(cherry picked from commit 34f87a58532ed652a6e0283c1d044ee5df0aef0b)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-04-18 22:05:20 +02:00
Anton Khirnov
95db1624ef indeo3: switch parsing the header to bytestream2
Also add an additional sanity check to the alt_quant table.
Fixes invalid reads with corrupted files.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
(cherry picked from commit 66531d634e75b834e89e4a6a0f7470ca018712a1)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-04-18 22:05:09 +02:00
Anton Khirnov
b0b33ce148 indeo3: check motion vectors.
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
(cherry picked from commit a0a872d0733f60876b0c93f236bc4606f36fbf89)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-04-18 22:04:53 +02:00
Anton Khirnov
fa4192e31f rv10: check that extradata is large enough
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org

(cherry picked from commit 01d376f598fe95478036f5d1e3e5e14ffe32d4bf)

Conflicts:

	libavcodec/rv10.c
2013-04-18 22:03:32 +02:00
Anton Khirnov
4c412580fd indeo3: fix data size check
The data offsets are relative to the bistream header, which is 16 bytes
after the start of the data.
Fixes invalid reads with corrupted files.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
(cherry picked from commit 34e6af9e204ca6bb18d8cf8ec68fe19b0e083e95)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-04-18 22:01:24 +02:00
Anton Khirnov
8f558c3e10 af_channelmap: sanity check input channel indices in all cases.
Fixes invalid reads from non-existing channels.

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-04-18 21:59:28 +02:00
Anton Khirnov
5ebdfbe893 id3v2: pad the APIC packets as required by lavc.
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-04-08 22:25:27 +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
Anton Khirnov
62f9253781 dfa: check for invalid access in decode_wdlt().
This can happen when the number of skipped lines is not consistent with
the number of coded lines.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 3623589edc7b1257bb45aa9e52c9631e133f22b6)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-04-06 11:47:56 +02:00
Anton Khirnov
858864d350 xmv: check audio track parameters validity.
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit d1016dccdcb10486245e5d7c186cc31af54b2a9c)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-04-06 11:47:41 +02:00
Anton Khirnov
ba31b72f46 bmv: check for len being valid in bmv_decode_frame().
It can be 0 or -1 for invalid files, which may result in invalid memory
access.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit b88f902125ee808c8366e9dcb3f21e4c227483fc)

Conflicts:

	libavcodec/bmv.c
2013-04-06 11:47:01 +02:00
Anton Khirnov
7594868296 xmv: do not leak memory in the error paths in xmv_read_header()
CC: libav-stable@libav.org
(cherry picked from commit f8080bd13b5f7fc48204b17fa59a5ce9feb15f07)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-04-06 11:40:20 +02:00
Luca Barbato
09e391abd8 matroska: pass the lace size to the matroska_parse_rm_audio
Each lace must be independent according to the specification.

Fix heap-buffer-overflow in matroska_parse_block for
corrupted real media in mkv files.

Stricter check than fc43c19a567aa945398dccb491d972c11ec2a065

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-04-06 11:40:05 +02:00
Dale Curtis
b90816d94b matroska: Update the available size after lace parsing
Fix heap-buffer-overflow in matroska_parse_block for
corrupted real media in mkv files.

CC: libav-stable@libav.org

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-04-06 11:39:39 +02:00
Luca Barbato
05015d03da matroska: fix a corner case in ebml-lace parsing
Make sure we notice when the lace_size[n] is a negative value.

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-04-06 11:39:28 +02:00
Anton Khirnov
34ecaf6e88 avfiltergraph: check for sws opts being non-NULL before using them.
Avoid snprintfing a NULL pointer.

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-04-06 11:39:11 +02:00
Carl Eugen Hoyos
bb46240cbb Skip padding in an id3 tag in aiff files.
Fixes ticket #2430.

Reviewed-by: Matthieu Bouron
(cherry picked from commit db2d3a90825025b2f5da85792e1df33280c61391)
2013-04-03 23:24:23 +02:00
Paul B Mahol
5ee539f69d smacker: fix off by one error
Regression since a93b572ae4f517ce0c35cf085167c318e9215908.

Fixes #2426.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit e3cc92a623a6ece42816c7a692c8815688a99ab0)
2013-04-03 15:17:11 +02:00
Carl Eugen Hoyos
8ba3198549 Write broken aac frames to mov files instead of skipping them.
Fixes decoding with picky media players.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b448c0a68d0cc7dfef736267dfdaed0e213c020b)
2013-04-02 12:50:16 +02:00
Diego Biurrun
8355383802 configure: Enable hwaccels without external dependencies by default.
(cherry picked from commit 2e2ec667416d8ed345491ac360fccc94e7a4772f)

This is a fixup for f074618 to reenable auto-detection of dxva in the
build environment.

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-03-31 18:08:19 +02:00
Luca Barbato
c0f7df9662 oma: Validate sample rates
The sample rate index is 3 bits even if currently index 5, 6 and 7 are
not supported.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 0933fd1533560fbc718026e12f19a4824b041237)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-03-31 18:07:31 +02:00
Matt Wolenetz
fc6825ebb6 vp8: Fix pthread_cond and pthread_mutex leaks
CC: libav-stable@libav.org

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-03-31 10:38:22 +02:00
Diego Biurrun
f074618a9f configure: Refactor dxva2api.h dependency declarations
(cherry picked from commit 215cdd35efd625ec28ef5846f1692b18f7c2c230)

Fixes Bug: #482
2013-03-31 10:38:22 +02:00
Justin Ruggles
c6dce25967 flvdec: read audio sample size and channels metadata
This is needed in order for the FLV demuxer not to detect a codec change when
using the "flv_metadata" option.
(cherry picked from commit e46a2a7309d8e8b8c1573047731dea77695d0ce1)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-03-31 10:38:22 +02:00
Justin Ruggles
aba56c03b9 flvdec: use the correct audio codec id when parsing metadata
(cherry picked from commit c3d015775388882b8a122afc337ea35108f652be)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-03-31 10:38:20 +02:00
Reinhard Tartler
2e06758479 Prepare for 9.5 Release 2013-03-31 10:38:19 +02:00
Carl Eugen Hoyos
fc7071cb53 Only test the first frame for missing aac_adtstoasc bistream filter.
Many players ignore broken aac frames, so don't abort mov or flv
muxing when encountering one, just print a warning instead.

Fixes ticket #2380.
(cherry picked from commit 1741fece7073f51efdd837a4f307ea2cdf3d1cfb)
2013-03-27 00:52:39 +01:00
Reinhard Tartler
2dfe3a7b4d update Changelog 2013-03-23 14:45:10 +01:00
Reinhard Tartler
9d5f16f6fe add missed CVE reference in 9.2 release 2013-03-23 14:45:10 +01:00
Reinhard Tartler
dc794d7096 fate: fetch samples that match the release series
The idea is to ensure that 'make fate-rsync' always fetches the fate
samples that work with this release.
2013-03-23 14:45:01 +01:00
Kostya Shishkov
31a77177ff iff: validate CMAP palette size
Fixes CVE-2013-2495

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-03-18 20:23:37 +01:00
Michael Niedermayer
9b0d0fd3c4 MAINTAINERS: mention that people are welcome to pick up and maintain older releases
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7e1efeb5707ec0fec000d42fa9f2861bab97bd8f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-18 03:35:47 +01:00
Michael Niedermayer
9925dca119 MAINTAINERS: update for 1.2
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 80f91a70be5f03fc95eb89d222d760eeaf91b135)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-18 03:35:36 +01:00
Michael Niedermayer
3d5323a351 dnxhddec: return the correct number of bytes from decode_frame
Fixes Ticket2022

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-18 03:34:25 +01:00
ArnoB
69659389a3 dpxenc: fix data offset
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 361319d0f49475bc14c744194870f9bab78a8a83)

Conflicts:

	tests/ref/lavf/dpx

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-18 03:27:33 +01:00
Michael Niedermayer
731902bd19 rmdec: flush audio packet on seeking
Fixes Ticket1605

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-18 03:17:28 +01:00
Michael Niedermayer
85a685ac0a Merge remote-tracking branch 'qatar/release/9' into release/1.1
* qatar/release/9:
  hqdn3d: Fix out of array read in LOWPASS
  vf_gradfun: fix uninitialized variable use

Conflicts:
	libavfilter/vf_hqdn3d.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-18 03:11:58 +01:00
Michael Niedermayer
bd593a98dc Merge commit 'c50241080d7599c90fc8b4e74c5f8d62a4caae52' into release/1.1
* commit 'c50241080d7599c90fc8b4e74c5f8d62a4caae52':
  vf_hqdn3d: fix uninitialized variable use
  lzo: fix overflow checking in copy_backptr()
  flacdec: simplify bounds checking in flac_probe()
  atrac3: avoid oversized shifting in decode_bytes()
  shorten: use the unsigned type where needed
  shorten: report meaningful errors
  shorten: K&R formatting cosmetics
  shorten: set invalid channels count to 0

Conflicts:
	libavcodec/shorten.c
	libavformat/flacdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-18 03:05:36 +01:00
Carl Eugen Hoyos
6f787aa79b Do not (re-)set libx264 parameter b_tff if interlaced encoding was not requested.
Reconfiguring can break x264 lossless encoding.

Fixes ticket #2165.
(cherry picked from commit 75c7e4583f4fd727d236a12763a265502fe00988)
2013-03-18 02:13:34 +01:00
Loren Merritt
1e7f825a9b hqdn3d: Fix out of array read in LOWPASS
CC:libav-stable@libav.org
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 5b3c1aecb253828d09fa9825c5a4aed97badf086)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-03-16 07:58:07 +01:00
Anton Khirnov
c50241080d vf_hqdn3d: fix uninitialized variable use
CC:libav-stable@libav.org
(cherry picked from commit d0a863ac891eae49ceaa4de7f759270bc87e668d)

Conflicts:

	libavfilter/vf_hqdn3d.c
2013-03-16 07:58:07 +01:00
Anton Khirnov
a0361a6c30 vf_gradfun: fix uninitialized variable use
CC:libav-stable@libav.org
(cherry picked from commit 887d31d455915b6bde6814063384dafdee61164c)

Conflicts:

	libavfilter/vf_gradfun.c
2013-03-16 07:58:07 +01:00
Xi Wang
22c27e1f4a lzo: fix overflow checking in copy_backptr()
The check `src > dst' in the form `&c->out[-back] > c->out' invokes
pointer overflow, which is undefined behavior in C.

Remove the check.  Also replace `&c->out[-back] < c->out_start' with
a safe form `c->out - c->out_start < back' to avoid overflow.

CC: libav-stable@libav.org

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

(cherry picked from commit ca6c3f2c53be70aa3c38e8f1292809db89ea1ba6)
2013-03-15 13:21:15 +01:00
Xi Wang
9d4355d90a flacdec: simplify bounds checking in flac_probe()
Simplify `p->buf > p->buf + p->buf_size - 4' as `p->buf_size < 4'.
Avoid a possible out-of-bounds pointer, which is undefined behavior
in C.

CC: libav-stable@libav.org

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

(cherry picked from commit 8425d693eefbedbb41f91735614d41067695aa37)
2013-03-15 13:21:07 +01:00
Xi Wang
0b0e87bb54 atrac3: avoid oversized shifting in decode_bytes()
When `off' is 0, `0x537F6103 << 32' in the following expression invokes
undefined behavior, the result of which is not necessarily 0.

    (0x537F6103 >> (off * 8)) | (0x537F6103 << (32 - (off * 8)))

Avoid oversized shifting.

CC: libav-stable@libav.org

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

(cherry picked from commit eba1ff31304e407db3cefd7532108408f364367b)
2013-03-15 13:20:55 +01:00
Michael Niedermayer
4fb6fa477e update for 1.1.4
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-14 17:39:57 +01:00
Michael Niedermayer
c8557235fd jpegdec: be less picky on padding
Fixes Ticket2353

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-14 17:37:19 +01:00
Michael Niedermayer
f719e6566c iff: fix integer overflow
Fixes out of array accesses

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-14 04:59:03 +01:00
Michael Niedermayer
b9a1efa6f4 msrledec: fix output_end checks
Fixes out of array accesses

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-14 04:58:54 +01:00
Michael Niedermayer
3ee967c1d8 msrledec: merge switches
More speedup and fixes 'may be used uninitialized in this function' warnings

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-14 04:58:01 +01:00
Michael Niedermayer
e44f89371c msrledec: move loop into switch
speeds up code and allows more simplifications

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-14 04:57:44 +01:00
Michael Niedermayer
e586e4d93b msrledec: move output pointer test up
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c2992b705381e082e33633e62e151887da67b285)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-14 04:57:36 +01:00
Michael Niedermayer
f156dc54f8 mpegaudio_parser: fix off by 1 error
See:
commit 29d8cd265a536063420afe78375b2176a9e1abc5
Author: Alexander Kojevnikov <alexander@kojevnikov.com>
Date:   Tue Feb 26 21:47:11 2013 -0800

    mp3dec: Fix VBR bit rate parsing

    When parsing the Xing/Info tag, don't set the bit rate if it's an Info tag.

    When parsing the stream, don't override the bit rate if it's already set,
    otherwise calculate the mean bit rate from parsed frames. This way, the bit
    rate will be set correctly both for CBR and VBR streams.

    Signed-off-by: Alexander Kojevnikov <alexander@kojevnikov.com>
    Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-14 04:42:08 +01:00
Michael Niedermayer
685f50b374 Merge remote-tracking branch 'qatar/release/9' into release/1.1
* qatar/release/9:
  eamad: allocate a dummy reference frame when the real one is missing
  libmp3lame: use the correct remaining buffer size when flushing
  png: use av_mallocz_array() for the zlib zalloc function
  wmaprodec: require block_align to be set.
  ffv1: fix calculating slice dimensions for version 2
  xxan: fix invalid memory access in xan_decode_frame_type0()
  wmadec: require block_align to be set.
  ivi_common: do not call MC for intra frames when dc_transform is unset

Conflicts:
	libavcodec/ffv1dec.c
	libavcodec/ivi_common.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-14 04:27:35 +01:00
Michael Niedermayer
6086a4d74d Merge commit '747fbe0c212b81952bb27ec7b99fa709081e2d63' into release/1.1
* commit '747fbe0c212b81952bb27ec7b99fa709081e2d63':
  roqvideodec: fix a potential infinite loop in roqvideo_decode_frame().
  mp3dec: Fix VBR bit rate parsing
  wmaprodec: return an error, not 0, when the input is too small.
  vmdaudio: fix invalid reads when packet size is not a multiple of chunk size
  h264: check for luma and chroma bit dept being equal
  Prepare for 9.4 Release

Conflicts:
	RELEASE
	libavcodec/vmdav.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-14 02:49:31 +01:00
Luca Barbato
88089eecfd shorten: use the unsigned type where needed
get_uint returns an unsigned value, use an unsigned to store
blocksize to make sure the comparison logic is correct and report
correctly the error for the channel count not supported.

CC: libav-stable@libav.org

(cherry picked from commit 5cf7c72757779a740e897a97710aac044fe5258c)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-03-12 13:37:10 +01:00
Luca Barbato
0daf1428e8 shorten: report meaningful errors
(cherry picked from commit 4c364eb2b856fc33cf7b42f7c7b979e69fde5f3a)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-03-12 13:37:10 +01:00
Luca Barbato
97cc2f286f shorten: K&R formatting cosmetics
(cherry picked from commit a2ad554def214d2d03b7c16f68dc081a8622f9ca)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-03-12 13:37:10 +01:00
Michael Niedermayer
21d568be17 shorten: set invalid channels count to 0
Prevent the loop shorten_decode_close from writing and freeing out of
the array boundary.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

CC: libav-stable@libav.org

(cherry picked from commit c10da30d8426a1f681d99a780b6e311f7fb4e5c5)
2013-03-12 13:36:50 +01:00
Michael Niedermayer
d84c51904c mpegts: clear avprograms only for removed programs
Fixes Ticket2186

Requested-by: carl
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 806a66fd08a395486e763fb10588c5fd02e8d54e)
2013-03-10 10:06:09 +01:00
Anton Khirnov
0cb3cab343 eamad: allocate a dummy reference frame when the real one is missing
Fixes invalid reads when the first frame is not an I-frame.

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

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-03-09 19:05:42 +01:00
Justin Ruggles
b77d9cbbd5 libmp3lame: use the correct remaining buffer size when flushing
CC:libav-stable@libav.org
(cherry picked from commit e984f47873258b600fd88423f40e3cdaad179190)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-03-09 18:10:16 +01:00
Justin Ruggles
905f5c8a1e png: use av_mallocz_array() for the zlib zalloc function
Fixes valgrind uninitialized memory errors when decoding png.

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-03-09 18:10:16 +01:00
Anton Khirnov
20373a66ec wmaprodec: require block_align to be set.
Avoids an infinite loop in the calling programs with decoder not
consuming any input and not returning output.

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-03-09 18:10:16 +01:00
Anton Khirnov
d48da91373 ffv1: fix calculating slice dimensions for version 2
It got broken in 0f13cd3187192ba0cc2b043430de6e279e7b97c3.

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-03-09 18:10:16 +01:00
Anton Khirnov
62a657de16 xxan: fix invalid memory access in xan_decode_frame_type0()
The loop a few lines below the xan_unpack() call accesses up to
dec_size * 2 bytes into y_buffer, so dec_size must be limited to
buffer_size / 2.

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-03-09 18:10:16 +01:00
Anton Khirnov
747fbe0c21 roqvideodec: fix a potential infinite loop in roqvideo_decode_frame().
When there is just 1 byte remanining in the buffer, nothing will be read
and the loop will continue forever. Check that there are at least 8
bytes, which are always read at the beginning.

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-03-09 18:01:09 +01:00
Anton Khirnov
c1f479e8df wmadec: require block_align to be set.
Avoids an infinite loop in the calling programs with decoder not
consuming any input and not returning output.

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-03-09 18:01:09 +01:00
Alexander Kojevnikov
d3b40af01f mp3dec: Fix VBR bit rate parsing
When parsing the Xing/Info tag, don't set the bit rate if it's an Info tag.

When parsing the stream, don't override the bit rate if it's already set,
otherwise calculate the mean bit rate from parsed frames. This way, the bit
rate will be set correctly both for CBR and VBR streams.

CC:libav-stable@libav.org

Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit eae0879d961b78717dd2a0899809ad22819ae9e3)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-03-09 18:01:09 +01:00
Anton Khirnov
74880e78d8 ivi_common: do not call MC for intra frames when dc_transform is unset
CC:libav-stable@libav.org
(cherry picked from commit 3ba40ebb6cc58753dc3746c718203bb31760deba)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-03-09 18:01:09 +01:00
Anton Khirnov
60dd8b5733 wmaprodec: return an error, not 0, when the input is too small.
Returning 0 may result in an infinite loop in valid calling programs. A
decoder should never return 0 without producing any output.

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-03-09 18:01:09 +01:00
Anton Khirnov
77cf052e39 vmdaudio: fix invalid reads when packet size is not a multiple of chunk size
CC:libav-stable@libav.org
(cherry picked from commit f86d66bcfa48998b0727aa0d1089a30cbeae0933)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-03-09 18:01:09 +01:00
Luca Barbato
146eac0a0c h264: check for luma and chroma bit dept being equal
The decoder assumes a single bit depth for all the planes
while the specification allows different bit depths for luma
and chroma.

Avoid the possible problems described in CVE-2013-2277

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

Conflicts:

	libavcodec/h264.c
2013-03-09 18:01:09 +01:00
Reinhard Tartler
4852b3aabd Prepare for 9.4 Release 2013-03-09 18:01:05 +01:00
Michael Niedermayer
41313bdcc5 aacsbr: Check for envelope scalefactors overflowing
This prevents various values from becoming stuck at NAN and
output to become silent
If someone knows a cleaner solution, thats welcome!

Fixes Ticket2335

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8978c743fb1d1f5a0d6dbdd83ff05817f8a41230)
2013-03-08 20:03:42 +01:00
Michael Niedermayer
088ba9bc3e psymodel: dont apply lowpass filters with a cutoff close to the nyquist
The IIR filter numerically diverges in such cases, this could easily be
fixed but would make the filter slower on some platforms

Fixes Ticket2246

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit fee5da6b0a79bed9dc849f216b6da1e03132b668)
2013-03-07 19:58:05 +01: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
a8fc0bb608 hls: fix timebase
Fixes Ticket1733

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a12a618aa9c6d84ec3c01695fb5aec9796453a6d)
2013-03-07 14:56:57 +01:00
Michael Niedermayer
7c8beec48c buildsys: only include log2_tab per library for shared builds
Fix linking failures with -all_load due to multiple log2_tabs

Signed-off-by: Carl Eugen Hoyos <cehoyos@ag.or.at>
(cherry picked from commit 03148fd1743fca98c2f4b5920b796f381e820045)
2013-03-05 01:17:55 +01:00
Michael Niedermayer
992957ac30 Merge remote-tracking branch 'qatar/release/9' into release/1.1
* qatar/release/9:
  update Changelog
  h264: set ref_count to 0 for intra slices.
  h264: on reference overflow, reset the reference count to 0, not 1.
  flvdec: Check the return value of a malloc

Conflicts:
	Changelog
	libavcodec/h264.c
	libavformat/flvdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-03 12:15:14 +01:00
Michael Niedermayer
b3c8fd1f0e Merge commit '1b0082eabcc98e079d33c61da4d30ded89de68a9' into release/1.1
* commit '1b0082eabcc98e079d33c61da4d30ded89de68a9':
  flvdec: Don't read the VP6 header byte when setting codec type based on metadata
  vorbisdec: Accept 0 amplitude_bits
  vorbisdec: Error on bark_map_size equal to 0.
  vorbisdec: Add missing checks
  ac3dec: validate channel output mode against channel count

Conflicts:
	libavcodec/ac3dec.c
	libavformat/flvdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-03 11:56:42 +01:00
Michael Niedermayer
7327505883 rtmpproto: Check APP_MAX_LENGTH
Fixes Ticket2292

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-03 11:53:29 +01:00
Reinhard Tartler
a3b3096772 update Changelog 2013-03-02 11:27:05 +01:00
Anton Khirnov
704952fee5 h264: set ref_count to 0 for intra slices.
CC:libav-stable@libav.org
(cherry picked from commit 437211ae73ef1ed8285b4fed7620502ea4999e11)

Fixes deadlocks waiting for non-existing references with some fuzzed files.

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-03-02 11:20:59 +01:00
Anton Khirnov
b6f5a1ca58 h264: on reference overflow, reset the reference count to 0, not 1.
Since decode_slice_header() returns before the reference lists are
constructed, there are zero valid references.

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

Conflicts:

	libavcodec/h264.c
2013-03-02 11:20:59 +01:00
Martin Storsjö
efa8603518 flvdec: Check the return value of a malloc
The callers of this function can't report errors sanely. If this
one malloc fails, don't write the extradata byte, make sure we
try to malloc it the next time we're called instead, and make sure
we still consume the input data byte.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit c5a738ca4e9789b4678b10240777d931e7dc24c9)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-03-02 09:55:33 +01:00
Martin Storsjö
1b0082eabc flvdec: Don't read the VP6 header byte when setting codec type based on metadata
This header byte is only present when actually reading a VP6 frame,
not when reading the codec type field in the metadata. This
potential bug has been present since 5b54a90c.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit c91c63b5380bf79655c09320774a022f84d76fd5)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-03-02 09:55:21 +01:00
Carl Eugen Hoyos
78dbb1a7e1 Require at least three frames to autodetect loas.
(cherry picked from commit a60530e3ee1d9532c026a52b03661f88e163d647)
2013-03-02 02:04:55 +01:00
Nicolas George
4f3f2fe14b lavf/avio: check for : in filenames for protocols.
If the first "special" character in a filename is a comma,
it can introduce protocol options, but only if there is a
colon at the end. Otherwise, it is just a filename with a
comma.

Fix trac ticket #2303.
(cherry picked from commit d9fad53f4b447db1e436dcf3fc4a57e604616e6c)
2013-03-01 08:52:59 +01:00
Michael Niedermayer
cdbaaa4f00 doc/ffmpeg: remove non ascii char
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-27 16:16:04 +01:00
David Favor
d4d1f32e48 Slight bug building ffmpeg-1.1.3 on OSX + patch to fix
Two instances of non-ascii characters have crept into file
doc/filters.texi which causes pod2man to error out and
break the build.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-27 16:16:03 +01:00
Luca Barbato
c6c4dc6935 vorbisdec: Accept 0 amplitude_bits
The specification does not prevent an encoder to write the amplitude 0
as 0 amplitude_bits.

Our get_bits() implementation might not support a zero sized read
properly, thus the additional branch.
(cherry picked from commit 23bd9ef4b209c789d5473d75f89a2e411d343d80)

Conflicts:

	libavcodec/vorbisdec.c
2013-02-26 20:21:01 +01:00
Michael Niedermayer
494ddd377a vorbisdec: Error on bark_map_size equal to 0.
The value is used to calculate output LSP curve and a division by zero
and out of array accesses would occur.

CVE-2013-0894

CC: libav-stable@libav.org

Reported-by: Dale Curtis <dalecurtis@chromium.org>
Found-by: inferno@chromium.org
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 11dcecfcca0eca1a571792c4fa3c21fb2cfddddc)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-02-26 20:21:01 +01:00
Luca Barbato
37e99e384e vorbisdec: Add missing checks
Rate and order must not be 0 even if the specification does not say that
explicitly.
(cherry picked from commit 5b47c19bfda92273ae49e83db26a565afcaed80a)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-02-26 20:21:01 +01:00
Justin Ruggles
73d6f4651e ac3dec: validate channel output mode against channel count
Damaged frames can lead to a mismatch, which can cause a segfault
due to using an incorrect channel mapping.

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

Conflicts:

	libavcodec/ac3dec.c
2013-02-26 20:21:01 +01:00
Michael Niedermayer
50ebb524cd doc/APIchanges: List merge commit hashes and version numbers
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-26 03:39:44 +01:00
Michael Niedermayer
98e96652f1 apichanges: fix 2 wrong hashes
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2f3bc5122822687dc388f7352c92cf6db456cf7c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-26 03:39:44 +01:00
Michael Niedermayer
4bde8c1369 apichanges: Use , instead of / to seperate multiple hashes
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 33d6330652c088dadde163da569b1a2f6c7603c0)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-26 03:39:44 +01:00
Michael Niedermayer
ece16d91ee apichanges: fix date
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ad6802f975a91bf6757fe3729ef8c6f10e6796b7)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-26 03:39:44 +01:00
Michael Niedermayer
3348e66e2e doc/APIchanges: fix odd .01 versions
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 9f16cb9e50a5a196af9244dc7d33ed193227528a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-26 03:39:44 +01:00
Michael Niedermayer
6e8ed38fab aac: reconfigure output on pop
Fixes Ticket1918

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-26 03:39:44 +01:00
Michael Niedermayer
f64e4a8c9a Merge remote-tracking branch 'qatar/release/9' into release/1.1
* qatar/release/9:
  doc: developer: Allow tabs in the vim configuration for Automake files
  doc: filters: Correct BNF FILTER description
  Prepare for 9.3 Release
  update Changelog
  cavs: initialize various context tables to 0
  4xm: check the return value of read_huffman_tables().
  qtrle: add more checks against pixel_ptr being negative.
  mlpdec: do not try to allocate a zero-sized output buffer.
  av_memcpy_backptr: avoid an infinite loop for back = 0
  flicvideo: avoid an infinite loop in byte run compression
  lagarith: avoid infinite loop in lag_rac_refill()
  mov: use the format context for logging.
  loco: check that there is data left after decoding a plane.
  update Changelog
  x86: h264: Don't use redzone in AVX h264_deblock on Win64

Conflicts:
	Changelog
	RELEASE
	libavcodec/4xm.c
	libavcodec/loco.c
	libavcodec/qtrle.c
	libavutil/mem.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-26 03:09:41 +01:00
James Almer
d92a7870d7 lavc/bink: Chech for malloc failure
Based on commit 8ab2173ed141aa2c3336be7f9880340dfb8dcf5e
2013-02-25 05:53:20 -03:00
James Almer
5fb5ac7148 doc/Makefile: Fix make docclean
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4f8b73129bb3845d9aadbf3dec3027b1136092a6)
2013-02-25 05:52:17 -03:00
James Almer
8d3bc52acd latmenc: Check for LOAS sync word
Write the packet unaltered if found.

Fixes ticket #1917

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b454c64e0311d813fef9c22cf34f83c2ce77ab23)
2013-02-25 05:52:16 -03:00
Diego Biurrun
dc745b76aa doc: developer: Allow tabs in the vim configuration for Automake files
While we do not use Automake in libav, this allows our config to be
used more globally without introducing unwanted breakage.
(cherry picked from commit 040c565e51985477a8fa5e42d2ddfb26ebde6608)

Conflicts:

	doc/developer.texi
2013-02-24 18:42:02 +01:00
Vicente Jimenez Aguilar
b6ae41e7f4 doc: filters: Correct BNF FILTER description
Signed-off-by: Diego Biurrun <diego@biurrun.de>
(cherry picked from commit b5ad422bf4e671a8b30ce73ad236cd6b49940af9)
2013-02-24 18:42:02 +01:00
Reinhard Tartler
670128ff13 Prepare for 9.3 Release 2013-02-24 09:29:17 +01:00
Michael Niedermayer
1f9073f41b vf_mp: Set pseudo pal
Fixes ticket2140
Fixes null pointer dereference

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 73fce258b774d0480f2d2dd7ec81fa1ec1b27812)
2013-02-23 22:18:38 +01:00
Reinhard Tartler
a991c0673f update Changelog 2013-02-23 14:49:16 +01:00
Anton Khirnov
77493bfd97 cavs: initialize various context tables to 0
Avoids crashes with corrupted files.

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

Conflicts:

	libavcodec/cavs.c

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-02-23 14:46:54 +01:00
Anton Khirnov
bb3f1cad17 4xm: check the return value of read_huffman_tables().
CC:libav-stable@libav.org
(cherry picked from commit 8097fc9a2dd49d8e467b16c8bafaa96242b7fe46)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-02-23 14:41:24 +01:00
Anton Khirnov
a6403a3b69 qtrle: add more checks against pixel_ptr being negative.
CC:libav-stable@libav.org
(cherry picked from commit e10659244782b26061e7d52c06437de32a43a7af)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-02-23 14:41:10 +01:00
Anton Khirnov
e2cf32ca5f mlpdec: do not try to allocate a zero-sized output buffer.
CC:libav-stable@libav.org
(cherry picked from commit 0dff40bfb9a0b24d56ecd64cd90c8f724cc5745f)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-02-23 14:40:48 +01:00
Anton Khirnov
48fd461977 av_memcpy_backptr: avoid an infinite loop for back = 0
CC:libav-stable@libav.org
(cherry picked from commit f935aca44c674d30e3ed940ef73bbad1228a5855)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-02-23 14:40:30 +01:00
Anton Khirnov
612b28194b flicvideo: avoid an infinite loop in byte run compression
When byte_run is 0, pixel_countdown is not touched and the loop will run
forever.

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-02-23 14:40:13 +01:00
Anton Khirnov
8bce2c60b8 lagarith: avoid infinite loop in lag_rac_refill()
range == 0 happens with corrupted files

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-02-23 14:40:04 +01:00
Anton Khirnov
488ffb8135 mov: use the format context for logging.
CC:libav-stable@libav.org
(cherry picked from commit 56daf10e0313c5e36f43e773f457d2a99ff0df10)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-02-23 14:39:52 +01:00
Anton Khirnov
b786ddc0f2 loco: check that there is data left after decoding a plane.
CC:libav-stable@libav.org
(cherry picked from commit 067432c1c95882c7221e694f33d9f3bdbe46de7f)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-02-23 14:39:19 +01:00
Reinhard Tartler
88ae77cea4 update Changelog 2013-02-23 08:15:10 +01:00
Matt Wolenetz
5bed920971 Fix Win64 AVX h264_deblock by not using redzone on Win64
Thanks-to: "Ronald S. Bultje" <rsbultje@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 82a4a4e7caa96cea9aa2185c4c3110a5e9fde7c2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-23 01:47:05 +01:00
Michael Niedermayer
705e89d75f update for 1.1.3
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-22 22:53:53 +01:00
Andrea3000
ef688e7425 matroska: fix missing ,
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8d8c59480e1bbffb290b0790a7af378447c7f1fd)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-22 22:53:11 +01:00
Michael Niedermayer
02d1efdd5b h264: check that luma and chroma depth match
Fixes out of array access

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

Conflicts:

	libavcodec/h264_ps.c

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-22 22:53:11 +01:00
Michael Niedermayer
469cb61193 avcodec_decode_audio4: check got_frame_ptr before handling initial skip
Fixes out of array accesses

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-22 22:53:11 +01:00
Michael Niedermayer
a642be972d h264: ensure that get_format() is called when changing format but not otherwise.
Fixes Ticket2288

Tested-by: Stefano Pigozzi <stefano.pigozzi@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 04220b473e9d7b22d737405348f9904f22bcfb96)

Conflicts:

	libavcodec/h264.c
2013-02-22 22:53:11 +01:00
Matt Wolenetz
bc9d341be8 x86: h264: Don't use redzone in AVX h264_deblock on Win64
This fixes crashes in chromium on win64 on machines with AVX
(crashes that apparently aren't triggered by fate).

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

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-02-22 23:48:35 +02:00
Michael Niedermayer
80ddf7889e Merge remote-tracking branch 'qatar/release/9' into release/1.1
* qatar/release/9:
  doc: Fix some obsolete references to av* tools as ff* tools
  vqavideo: check chunk sizes before reading chunks
  roqvideodec: check dimensions validity
  qdm2: check array index before use, fix out of array accesses
  mpegvideo: Do REBASE_PICTURE with byte pointers

Conflicts:
	libavcodec/qdm2.c
	libavcodec/roqvideodec.c
	libavcodec/vqavideo.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-22 22:44:15 +01:00
Carl Eugen Hoyos
4be63111d1 Fix bits_per_coded_sample when encoding png with frame-level multithreading.
Fixes ticket #2290.
(cherry picked from commit c4dc6c4c86a052b7ba53fa7ae0c1b0643ad70d0b)
2013-02-21 09:04:05 +01:00
Vicente Jimenez Aguilar
6626a7df53 doc: Fix some obsolete references to av* tools as ff* tools
Signed-off-by: Diego Biurrun <diego@biurrun.de>

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-02-19 08:11:11 +01:00
Michael Niedermayer
ab434bf0d0 vqavideo: check chunk sizes before reading chunks
Fixes out of array writes

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

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

CC: libav-stable@libav.org

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
(cherry picked from commit f7d18deb73d1dd1b27b2c7062c9a10d168a6c62a)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-02-19 08:10:24 +01:00
Michael Niedermayer
52b18c1fde roqvideodec: check dimensions validity
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3ae610451170cd5a28b33950006ff0bd23036845)

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

CC: libav-stable@libav.org

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
(cherry picked from commit 488f87be873506abb01d67708a67c10a4dd29283)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-02-19 08:10:03 +01:00
Michael Niedermayer
0b2b8ab979 qdm2: check array index before use, fix out of array accesses
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

(cherry picked from commit a7ee6281f7ef1c29284e3a4cadfe0f227ffde1ed)

CC: libav-stable@libav.org

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
(cherry picked from commit 39bec05ed42e505d17877b0c23f16322f9b5883b)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-02-19 08:09:48 +01:00
Martin Storsjö
65bf4c9c45 mpegvideo: Do REBASE_PICTURE with byte pointers
REBASE_PICTURE (more specifically, this half of it) takes a Picture
pointer that points into one larger struct, finds the offset of
that Picture within the struct and finds the corresponding field
within another instance of a similar struct.

The pointer difference "pic - (Picture*)old_ctx" is a value given
in sizeof(Picture) units, and when applied back on
(Picture*)new_ctx gets multiplied back with sizeof(Picture). Many
compilers seem to optimize out this division/multiplication, but
not all do.

GCC 4.2 on OS X doesn't seem to remove the division/multiplication,
therefore the new pointer didn't turn out to point to exactly
the right place in the new struct since it only had sizeof(Picture)
granularity (and the Picture is not aligned on a sizeof(Picture)
boundary within the encompassing struct). This bug has been present
before 47318953d as well - with H264, pointers to h->ref_list[0][0]
pointed to 88 bytes before h->ref_list[0][0] after the rebase. After
shrinking Picture, the difference ended up even larger, making
writes via such a Picture pointer overwrite other fields at random
in H264Context, ending up in crashes later.

This fixes H264 multithreaded decoding on OS X with GCC 4.2.

Fixes Bug: #439

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-02-19 08:09:08 +01:00
Michael Niedermayer
7c40a0449b swr: check channel layouts before using them.
Fixes out of array accesses

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

Conflicts:

	libswresample/swresample.c

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-19 01:31:25 +01:00
Michael Niedermayer
811a504c6b shorten: dont leave invalid channel counts in the context.
Fixes freeing invalid addresses

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-19 01:28:52 +01:00
Michael Niedermayer
75211f2b8c tiff: Check buffer allocation and pointer increment more carefully in shorts2str() and double2str()
Fixes out of array accesses

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-19 01:28:46 +01:00
Michael Niedermayer
f6687bbb64 pngdec/filter: dont access out of array elements at the end
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1ac0fa50eff30d413206cffa5f47f7fe6d4849b1)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-19 01:28:41 +01:00
Michael Niedermayer
1400f1a1e4 sanm: Use the correct height variable in the decoded_size checks
Fixes integer overflow and out of array accesses

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-19 01:28:35 +01:00
Michael Niedermayer
1ea5bbc594 sanm: add forgotten check for decoded_size in old_codec37()
Fixes out of array accesses

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-19 01:28:30 +01:00
Michael Niedermayer
f5955d9f6f targa: Fix y check in advance_line
Fixes out of array accesses

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-19 01:28:24 +01:00
Hendrik Leppkes
e14564b926 lavfi/kerndeint: use av_pix_fmt_desc_get instead of directly accessing the table
Fixes FATE in MSVC DLL builds.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-19 01:25:44 +01:00
Michael Niedermayer
0f5a0a4155 Merge remote-tracking branch 'qatar/release/9' into release/1.1
* qatar/release/9:
  svq3: unbreak decoding
  build: make audio_frame_queue a stand-alone component
  build: The libopencore-amrnb encoder depends on audio_frame_queue
  libopencore-amrwb: Make AMR-WB ifdeffery more precise
  libopencore-amr: Conditionally compile decoder and encoder bits
  libopencore-amrnb: cosmetics: Group all encoder-related code together

Conflicts:
	configure
	libavcodec/Makefile

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-19 01:19:31 +01:00
Diego Biurrun
7acfa7758c configure: Make warnings from -Wreturn-type fatal errors
These warnings have no false positives and point to serious bugs.
(cherry picked from commit 99853cb8d4237b810b2fffb4a34f66fd0064ef72)

Conflicts:

	configure

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-19 00:52:44 +01:00
Michael Niedermayer
56b6909b39 movenc: hotfix, dont store fiel for h264 / mpeg4-asp / dnxhd
Other software does not store it in this case, and the information
is provided by the codec stream

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

Conflicts:

	tests/ref/lavf/mov
2013-02-18 18:22:04 +01:00
Michael Niedermayer
c6f59b95c5 h264: avoid calling get_format() multiple times
Some applications do not like that.
Fixes VDA
Reduces noise for VDPAU

Tested-by: Guillaume POIRIER <poirierg@gmail.com>
Tested-by: Carl Eugen Hoyos <cehoyos@ag.or.at>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit dece584a639c9fd61a72e21800815e8397b3b617)

Conflicts:

	libavcodec/h264.c
2013-02-18 18:14:11 +01:00
Matti Hamalainen
d61c6ebccf svq3: unbreak decoding
a7d2861d36756b913e85681b86ed3385274e8ced removed necessary braces.
2013-02-18 02:49:45 +01:00
Luca Barbato
b9a287f237 build: make audio_frame_queue a stand-alone component
Encoders requiring it have the dependency expressed in the configure.
2013-02-17 22:38:37 +01:00
Carl Eugen Hoyos
6407800521 Revert "swfenc: use av_get_audio_frame_duration() instead of AVCodecContext.frame_size"
This reverts commit 620b88a302d522f71a6a95aff500cf7bd8520043.

Fixes ticket #2272.

Conflicts:
	libavformat/swfenc.c
(cherry picked from commit 8d0757e1079f588ed69f629e2d1a4d5f232dc298)
2013-02-17 20:27:19 +01:00
Diego Biurrun
6c62098827 build: The libopencore-amrnb encoder depends on audio_frame_queue
CC: libav-stable@libav.org
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit d0fd1dd559b8362bdbca3405f739e0cc202d62e7)
2013-02-16 23:41:31 +01:00
Diego Biurrun
a23d6ea1e4 libopencore-amrwb: Make AMR-WB ifdeffery more precise
The library might provide an encoder in the future, so it's better to
check for the presence of the decoder rather than just the library.

CC: libav-stable@libav.org
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit ed89cad6aa04bbd692b3eb21c0e0bb56aca77130)
2013-02-16 23:41:31 +01:00
Diego Biurrun
e492818d89 libopencore-amr: Conditionally compile decoder and encoder bits
CC: libav-stable@libav.org
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit f6ad3ca159edcd2e48634bf39b9cd4a85af29cb1)
2013-02-16 23:41:31 +01:00
Diego Biurrun
1ca25bc387 libopencore-amrnb: cosmetics: Group all encoder-related code together
CC: libav-stable@libav.org
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 81ae57a269782fbfc9e11548d1e6605f13d65c9b)
2013-02-16 23:41:31 +01:00
Carl Eugen Hoyos
057051b848 Write the fiel atom to mov files independently of the used video coded.
The QuickTime specification does not contain any hint that the atom
must not be written in some cases and both the QuickTime and the
AVID decoders do not fail if the atom is present.

This change allows to signal (visually) interlaced streams with
a codec different from uncompressed video.

As a side-effect, this fixes ticket #2202
(cherry picked from commit 7d0e3b197c817b307d599a23704a44763ed0bbdd)

Conflicts:
	tests/ref/lavf/mov
2013-02-14 15:18:55 +01:00
Michael Niedermayer
71fee2ab1e sws: dont write out of array on bigendian
Fixes Ticket2229

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4e2c63685e031e28d2296cff76473b963ee62ba1)
2013-02-14 14:17:21 +01:00
Michael Niedermayer
7d3e217623 Merge remote-tracking branch 'qatar/release/9' into release/1.1
* qatar/release/9:
  arm: Fall back to runtime cpu feature detection via /proc/cpuinfo
  doc/platform: Fix 10l typo
  xxan: properly handle odd heights.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-14 13:50:08 +01:00
Michael Niedermayer
2ac6b573a4 h264: Reset last_pocs in case of reference or frame number inconsistencies
This prevents faulty increasing of has_b_frames
Should fix Ticket 2062

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c230af9bccc3cadb373f9007ba14fffb6c2acc75)
2013-02-14 13:33:44 +01:00
Michael Niedermayer
7f8846405e Merge commit 'b7765d00f911fe0f8fcda21b93a540f27d2ba2f5' into release/1.1
* commit 'b7765d00f911fe0f8fcda21b93a540f27d2ba2f5':
  msrledec: check bounds before constructing a possibly invalid pointer,
  qtrle: fix the topmost line for 1bit
  aasc: fix output for msrle compression.

Conflicts:
	tests/ref/fate/aasc
	tests/ref/fate/qtrle-1bit

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-14 13:14:54 +01:00
Michael Niedermayer
81bcf9454e Merge commit '108ca6fad1e0e9af8d6337f908bfd23807b7fbd6' into release/1.1
* commit '108ca6fad1e0e9af8d6337f908bfd23807b7fbd6':
  yop: check for input overreads.
  yop: check that extradata is large enough.
  fraps: fix off-by one bug for version 1.

Conflicts:
	libavcodec/fraps.c
	libavcodec/yop.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-14 12:57:14 +01:00
Michael Niedermayer
5a3c8f95d5 Merge commit '5bee21d724dc47d115faae3f5065a6db74e1594a' into release/1.1
* commit '5bee21d724dc47d115faae3f5065a6db74e1594a':
  vf_delogo: fix copying the input frame.
  vf_delogo: fix an uninitialized read.
  dnxhdenc: fix invalid reads in dnxhd_mb_var_thread().
  atrac3: use correct loop variable in add_tonal_components()

Conflicts:
	libavfilter/vf_delogo.c
	tests/ref/vsynth/vsynth1-dnxhd-1080i
	tests/ref/vsynth/vsynth2-dnxhd-1080i

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-14 12:27:48 +01:00
Michael Niedermayer
358e4081ed mlp: fix channel order.
This fixes a regression introduced with todays merge

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-14 12:13:15 +01:00
Michael Niedermayer
6baaaa0174 Merge commit '5af78cc98d807f3b43510410dad46e1840c5c99f' into release/1.1
* commit '5af78cc98d807f3b43510410dad46e1840c5c99f':
  mlp: store the channel layout for each substream.
  mlpdec: TrueHD: use Libav channel order.
  mlpdec: set the channel layout.
  x86: ac3: Fix HAVE_MMXEXT condition to only refer to external assembly

Conflicts:
	libavcodec/mlp_parser.c
	libavcodec/mlpdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-14 12:03:59 +01:00
Michael Niedermayer
9e3e11a348 Merge commit '1fd2deedcc6400e08b31566a547a5fac3b38cefb'
* commit '1fd2deedcc6400e08b31566a547a5fac3b38cefb':
  mlpdec: set the channel layout.

Conflicts:
	libavcodec/mlpdec.c

(cherry picked from commit 1cf6f6f3daa9d9ae54a4bf0267b510e1638e272b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-14 11:53:39 +01:00
Michael Niedermayer
1d20d975aa Merge commit '3ffcccb4fbaae4d5ad775506f1f2761f2029affa'
* commit '3ffcccb4fbaae4d5ad775506f1f2761f2029affa':
  mlpdec: TrueHD: use Libav channel order.

(cherry picked from commit cd6a8618b1f57a37e6bc639651fe5a657663409b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-14 11:53:26 +01:00
Michael Niedermayer
e67491a2a4 Merge commit '99ccd2ba10eac2b282c272ad9e75f082123c765a'
* commit '99ccd2ba10eac2b282c272ad9e75f082123c765a':
  mlp: store the channel layout for each substream.

Conflicts:
	libavcodec/mlp_parser.c
	libavcodec/mlpdec.c

(cherry picked from commit fa36270c4c68589882cfeae68a037f1d191231c2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-14 11:52:23 +01:00
Michael Niedermayer
e1a86b1433 mlpdec: dont leave a invalid huff_lsb in the context.
Fix assertion failure

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-14 11:48:25 +01:00
Martin Storsjö
5310da7e83 arm: Fall back to runtime cpu feature detection via /proc/cpuinfo
On recent android versions, /proc/self/auxw is unreadable
(unless the process is running running under the shell uid or
in debuggable mode, which makes it hard to notice). See
http://b.android.com/43055 and
https://android-review.googlesource.com/51271 for more information
about the issue.

This makes sure e.g. neon optimizations are enabled at runtime in
android apps even when built in release mode, if configured to
use the runtime detection.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit ab8f1a698990c33afb4c1c6ae5af3d6de4f696cb)

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-02-14 10:39:23 +02:00
Derek Buitenhuis
4eede1fca2 doc/platform: Fix 10l typo
This error was somehow missed for months.

(cherry picked from commit 130cefc9dcedea5babc349251fbeec6f037144ac)
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2013-02-13 21:35:10 -05:00
Anton Khirnov
b7765d00f9 msrledec: check bounds before constructing a possibly invalid pointer,
CC:libav-stable@libav.org
(cherry picked from commit 9bd6375d5f16842306dcecde637ffe605acda26b)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-02-07 07:18:57 +01:00
Kostya Shishkov
5479e08cc4 xxan: properly handle odd heights.
Duplicate the last one or two chroma lines.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
CC:libav-stable@libav.org
(cherry picked from commit 685e6f2e3939f124b41c7801cc541dad8252af3d)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-02-07 07:18:57 +01:00
Kostya Shishkov
d0249f1c2e qtrle: fix the topmost line for 1bit
Signed-off-by: Anton Khirnov <anton@khirnov.net>
CC:libav-stable@libav.org
(cherry picked from commit 89f11f498b9c15bc71494a11a7ec560f4adf630d)

Conflicts:

	cmdutils.c
2013-02-07 07:18:57 +01:00
Anton Khirnov
108ca6fad1 yop: check for input overreads.
CC:libav-stable@libav.org
(cherry picked from commit 8136f234445862c94d1c081606b2d1e3d44fccf3)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-02-07 07:18:56 +01:00
Anton Khirnov
5bee21d724 vf_delogo: fix copying the input frame.
CC:libav-stable@libav.org
(cherry picked from commit 7194330bcd6db8dc5c22e0c162a0992d519307f9)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-02-07 07:18:56 +01:00
Anton Khirnov
1f8bf163e4 aasc: fix output for msrle compression.
The bottom line was invalid before.

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

Conflicts:

	cmdutils.c
2013-02-07 07:18:56 +01:00
Anton Khirnov
7e35c50b81 yop: check that extradata is large enough.
CC:libav-stable@libav.org
(cherry picked from commit 06cf597c352519d2b70f293518c61b8c312f5d4f)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-02-07 07:18:56 +01:00
Anton Khirnov
e835ce83e2 vf_delogo: fix an uninitialized read.
CC:libav-stable@libav.org
(cherry picked from commit f81c37e40fe3236d54da12aef9cdba48ba70ec31)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-02-07 07:18:56 +01:00
Anton Khirnov
00bf66785f fraps: fix off-by one bug for version 1.
CC:libav-stable@libav.org
(cherry picked from commit 2cd4068071b9a8908823a3107f97e938211045ce)

Conflicts:

	cmdutils.c
	libavcodec/fraps.c
2013-02-07 07:18:56 +01:00
Anton Khirnov
e0e4250421 dnxhdenc: fix invalid reads in dnxhd_mb_var_thread().
Do not assume that frame dimensions are mod16 (or that height is mod32
for interlaced).

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-02-07 07:18:56 +01:00
Michael Karcher
901682ff78 atrac3: use correct loop variable in add_tonal_components()
Signed-off-by: Michael Karcher <ffmpeg@mkarcher.dialup.fu-berlin.de>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-02-07 07:18:56 +01:00
Tim Walker
5af78cc98d mlp: store the channel layout for each substream.
Also stop storing the channel arrangement in the header info, as it's unused outside of ff_mlp_read_major_sync.

Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-02-07 07:15:01 +01:00
Tim Walker
59f22ef91a mlpdec: TrueHD: use Libav channel order.
Fixes bug 208.

Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-02-07 07:15:01 +01:00
Tim Walker
5393a5600d mlpdec: set the channel layout.
Fixes bug 401.

Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>

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

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-02-07 07:15:01 +01:00
Diego Biurrun
077beee465 x86: ac3: Fix HAVE_MMXEXT condition to only refer to external assembly
CC: libav-stable@libav.org
(cherry picked from commit 4f56e773fe8a554b8c2662650aaf799c2ece2721)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-02-07 07:15:01 +01:00
Matthieu Bouron
02d3ad8609 lavf/mov: skip version and flags attributes in mov_read_chan function
Fixes ticket #1764.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 59d40fc7e66e6ebb2d89e25115492bfe13b07d95)
2013-02-06 23:24:19 +01:00
Michael Niedermayer
b48cf5412b ffmpeg: do not call exit from exit_program()
This should fix  Ticket2116

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-06 04:15:48 +01:00
Michael Niedermayer
5f3fa5f930 ffmpeg: dont allow -flags to override -pass
Fixes Ticket2154

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-06 02:03:05 +01:00
Michael Niedermayer
0e1bb99f26 update for 1.1.2
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-06 02:02:35 +01:00
Michael Niedermayer
d2c1a8dc2d ljpegenc: allocate needed scratch-buffer
Fixes null pointer dereference
Fixes Ticket2207

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c2dd5a18b27bb33d871d41fbed9104f3a68d68fe)
2013-02-06 00:11:11 +01:00
Michael Niedermayer
5a97a5291a riff: fix infinite loop
Fixes Ticket2241

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a8343bfb6a3f00777943b94ff2969422f578f246)
2013-02-06 00:10:05 +01:00
Michael Niedermayer
f6b50924a5 dvenc: dont fail hard if the timecode is invalid
Instead just dont store the timecode
Fixes Ticket2187

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f0eacbc760c8b27c2064cea5395e32971853c73c)
2013-02-06 00:09:03 +01:00
Michael Niedermayer
a55c274f51 movtextenc: fix pointer messup and out of array accesses
Fixes Ticket2213

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b0635e2fcf80717dd618ef75d3317d62ed85c300)
2013-02-06 00:07:02 +01:00
Michael Niedermayer
eaa9d2cd6b h264: skip error concealment when SPS and slices are mismatching
Fixes out of array accesses

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-05 16:53:12 +01:00
Michael Niedermayer
d3bec24739 h264: Only apply error concealment if theres a frame
Without any correctly decoded slices, there can be no frame.

Fixes out of array reads

Found-by: Rafaël Carré
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 60af6c3138dc501a647bc69b374d5d33d5d86ab5)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-05 16:53:03 +01:00
Michael Niedermayer
3ef1538121 h264: check the pixel format directly and force a reinit on mismatches.
The existing checks are insufficient to detect a pixel format
changes in case of some damaged streams.
Fixes inconsistency and later out of array accesses

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-05 16:50:52 +01:00
Michael Niedermayer
47e462eecc aacdec: check channel count
Prevent out of array accesses

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-05 16:48:04 +01:00
Michael Niedermayer
f3d1670606 vqavideo: check chunk sizes before reading chunks
Fixes out of array writes

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-05 16:47:59 +01:00
Michael Niedermayer
9547034f91 gifdec: gif_copy_img_rect: Fix end pointer
Fixes out of array accesses

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-05 16:47:53 +01:00
Michael Niedermayer
62c9beda0c sanm: Check decoded_size.
This prevents a buffer overflow in rle_decode()

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-05 16:47:41 +01:00
Diego Biurrun
0e68b6ddce Use proper "" quotes for local header #includes
(cherry picked from commit 6c1a7d07eb41b4cf36e48ebb560fecd9504fd968)

Conflicts:

	libavcodec/kbdwin.c
2013-02-05 16:35:28 +01:00
Michael Niedermayer
75e88db330 huffyuvdec: Skip len==0 cases
Fixes vlc decoding for hypothetical files that would contain such cases.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-05 16:33:37 +01:00
Michael Niedermayer
6baa549249 huffyuvdec: Check init_vlc() return codes.
Prevents out of array writes

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-05 16:33:37 +01:00
Piotr Bandurski
22561bc0e9 aasc: fix 16bpp on big-endian
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-05 16:33:37 +01:00
Michael Niedermayer
8a4464514f Merge remote-tracking branch 'qatar/release/9' into release/1.1
* qatar/release/9:
  arm: vp8: Fix the plain-armv6 version of vp8_luma_dc_wht
  Prepare for 9.2 Release
  lavr: call mix_function_init() in ff_audio_mix_set_matrix()
  rtpenc_chain: Use the original AVFormatContext for getting payload type
  rtp: Make sure the output format pointer is set

Conflicts:
	RELEASE

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-05 16:28:36 +01:00
Michael Niedermayer
85e94a30ee Merge commit '62de693a17f9b107be7867d822d5accacd4be544' into release/1.1
* commit '62de693a17f9b107be7867d822d5accacd4be544':
  rtp: Make sure priv_data is set before reading it
  videodsp_armv5te: remove #if HAVE_ARMV5TE_EXTERNAL
  get_bits: change the failure condition in init_get_bits
  mpegvideo: fix loop condition in draw_line()

Conflicts:
	libavcodec/get_bits.h
	libavcodec/mpegvideo.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-05 16:19:17 +01:00
Carl Eugen Hoyos
3445bec6fc Do not change codec in flv streams if the user has forced a codec.
Fixes ticket #2218.
(cherry picked from commit 6a50e8a190bc1329fd3e76e8497bb7f870b6e69b)
2013-02-01 23:37:48 +01:00
Matthieu Bouron
c8dace2728 ffmpeg: fix broken channel_layout option
Fixes ticket #2163.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5a67e30b1c71dc0a84779b543d95ca20faa8cbed)
2013-02-01 23:09:50 +01:00
Carl Eugen Hoyos
9bcb84810f doc/muxers.texi: Fix mp3 picture attachment documentation.
(cherry picked from commit 99eedfc40086972987aa27df8b1259c8bf15b20c)
2013-02-01 17:57:12 +01:00
Peter Ross
54e19092fd wtvdec: demux thumbnail picture to AVStream.attached_pic
Fixes ticket #2133.

(cherry picked from commit 508836932fcbc3c109fcc4df7a2f2b0bf21bbece)
2013-01-30 09:49:59 +01:00
Martin Storsjö
3d67f52f9d arm: vp8: Fix the plain-armv6 version of vp8_luma_dc_wht
This makes the plain-armv6 version use the same registers as the
armv6t2 version above.

This fixes fate-vp8 on plain-armv6 devices.

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

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-28 22:57:07 +02:00
Michael Niedermayer
bfd586577c movenc: check that fps for tmcd is within encodable range.
The fps is stored as a 8 bit value thus 255 is the maximum encodable.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-28 02:04:38 +01:00
Michael Niedermayer
5589549c1d movenc: Calculate fps for tmcd without intermediate step.
Fixes part of Ticket2045

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-28 02:04:37 +01:00
Michael Niedermayer
5c316acaa0 ffmpeg: copy tmcd track timebase parameters
Fixes part of Ticket2045

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-28 02:04:36 +01:00
Michael Niedermayer
f4fb841ad1 sanm: check image dimensions before using them
Avoids integer overflows and out of array accesses.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-28 01:57:39 +01:00
Xi Wang
c2d11275f7 rtmp: fix buffer overflows in ff_amf_tag_contents()
A negative `size' will bypass FFMIN().  In the subsequent memcpy() call,
`size' will be considered as a large positive value, leading to a buffer
overflow.

Change the type of `size' to unsigned int to avoid buffer overflow, and
simplify overflow checks accordingly.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4e692374f7962ea358c329de38c380103f8991b6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-28 01:57:39 +01:00
Xi Wang
b54c155f5b rtmp: fix multiple broken overflow checks
Sanity checks like `data + size >= data_end || data + size < data' are
broken, because `data + size < data' assumes pointer overflow, which is
undefined behavior in C.  Many compilers such as gcc/clang optimize such
checks away.

Use `size < 0 || size >= data_end - data' instead.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 902cfe2f74d777a7dc20ac68f2393b9f84b790c1)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-28 01:57:39 +01:00
Xi Wang
ea2d44503f rtpenc: fix overflow checking in avc_mp4_find_startcode()
The check `start + res < start' is broken since pointer overflow is
undefined behavior in C.  Many compilers such as gcc/clang optimize
away this check.

Use `res > end - start' instead.  Also change `res' to unsigned int
to avoid signed left-shift overflow.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2f014567cfd63e58156f60666f1a61ba147276ab)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-28 01:57:39 +01:00
Michael Niedermayer
59f7d583a3 mpeg1enc: Disable threads for resolutions too large for multi-threading
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0c6b0409af070a3bfb02b55fde8ba18219edc76b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-28 01:57:39 +01:00
Clément Bœsch
fb876e4572 lavf/srtdec: do not try to queue empty subtitle chunks.
Regression since 3af3a30.
Fixes Ticket2167.
(cherry picked from commit f2b6aabd3da7d0d15c7cea0a9fb649b530e2d3cb)
2013-01-27 16:32:57 +01:00
Paul B Mahol
c2d2bf1d6b lavc/iff: ilbm: unbreak decoding on big endian
Fixes ticket #2192.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit 25c75525bf1da38179ec67924f0be7a2bd8faa0d)
2013-01-26 15:10:02 +01:00
Michael Karcher
302094e1d2 Fix atrac3 decoder broken in e55d53905f34f8e8747f6d321e9a695dc02ebb2f
Signed-off-by: Michael Karcher <ffmpeg@mkarcher.dialup.fu-berlin.de>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit dcbb920f1587d1fce777aae947a49304665436b5)
2013-01-26 03:36:18 +01:00
Reinhard Tartler
8d55c2441c Prepare for 9.2 Release 2013-01-24 12:02:57 +01:00
Justin Ruggles
d7e7e12abc lavr: call mix_function_init() in ff_audio_mix_set_matrix()
This is needed if a custom matrix is set by the user after opening the
AVAudioResampleContext because the matrix channel count can change if
different mixing coefficients are used.

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

Conflicts:

	libavresample/audio_mix.c
2013-01-24 12:00:08 +01:00
Martin Storsjö
a856623e87 rtpenc_chain: Use the original AVFormatContext for getting payload type
In ff_rtp_get_payload_type, the AVFormatContext is used for checking
whether the payload_type or rtpflags options are set. In rtpenc_chain,
the rtpctx struct is a newly initialized struct where no options have
been set yet, so no options can be fetched from there.

All muxers that internally chain rtp muxers have the "rtpflags" field
that allows passing such options on (which is how this worked before
8034130e06), so this works just as intended.

This makes it possible to produce H263 in RFC2190 format with chained
RTP muxers.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 4a4a7e138c92901e04db46a6b05cc6948023e5f5)

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-24 11:58:09 +02:00
Martin Storsjö
348cd84fc8 rtp: Make sure the output format pointer is set
Not sure if this actually happens, but we do the same check when
checking payload_type further above in the function, so it might
be needed.

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

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-24 11:57:29 +02:00
Martin Storsjö
62de693a17 rtp: Make sure priv_data is set before reading it
This fixes crashes with muxing H263 into RTSP.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit e90820d4f815c15796e642467cdddbad755212a2)

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-24 11:56:43 +02:00
Carl Eugen Hoyos
33769e908d matroskaenc: add codec_tag lists back.
This reverts 312645e :
"Do not set codec_tag property for matroska muxers."

Also adds dummy codec_tag lists with codecs
supported in mkv but not in wav / avi.

Fixes ticket #2169.
(cherry picked from commit df39c3ce385c02cbd8046298578ea7454c0a0f81)
2013-01-24 02:30:40 +01:00
Janne Grunau
1a28948eb3 videodsp_armv5te: remove #if HAVE_ARMV5TE_EXTERNAL
libavutil/arm/asm.S sets '.arch' depending on HAVE_ARMV5TE so that
assembling armv5te code will always succeed even if the default -march
flag does not support it. HAVE_ARMV5TE_EXTERNAL tests assembling code
with the default arch.
Fixes the missing symbol ff_prefetch_arm with --cpu= not including
armv5te.

CC: libav-stable@libav.org
2013-01-22 13:43:16 +01:00
Luca Barbato
01050448cf get_bits: change the failure condition in init_get_bits
Too much code relies in having init_get_bits fed with a valid
buffer and set its dimension to 0.

Check for NULL buffer instead.
(cherry picked from commit 4603ec85ed620e585fc6e2e072c99858ed421855)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-01-20 14:06:52 +01:00
Michael Niedermayer
edc00dea02 update for 1.1.1
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-20 01:11:06 +01:00
Xi Wang
8d0631c8fa mpegvideo: fix loop condition in draw_line()
The loop condition `x = ex' is incorrect.  It should be `x <= ex'.

This bug was introduced in commit c65dfac4 "mpegvideo.c: K&R formatting
and cosmetics."

CC:libav-stable@libav.org

(cherry picked from commit 992b03183819553a73b4f870a710ef500b4eb6d0)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-01-19 22:21:23 +01:00
Michael Niedermayer
1135928903 init_get_bits: fix off by 1 error
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7980cca05c7c72fc8b0be4268eea2e156e538228)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-19 17:59:23 +01:00
Michael Niedermayer
6f3bc92c29 init_get_bits8: zero pointers & struct on error
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 153fad14e5a2f85637aa6c254ced0fc1c68974e2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-19 17:59:22 +01:00
Michael Niedermayer
bd531038e8 init_get_bits8: check byte_size against being positive
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ac73d3a12a33c5e4e6357d5f8824e19801663eb5)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-19 17:59:21 +01:00
Carl Eugen Hoyos
90da0cb60e The c99-to-c89 binaries are now hosted on videolan.org.
(cherry picked from commit c29c7c1470f98f8e66752fb09c44ded625e9a991)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-19 17:59:20 +01:00
Michael Niedermayer
3049d5b9b3 doc/RELEASE_NOTES
mention changed sample_fmt for audio decoders

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-19 16:31:51 +01:00
Michael Niedermayer
43c6b45a53 avcodec_decode_audio: do not trust the channel layout, use the channel count.
Fixes memory corruption

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-19 16:18:08 +01:00
Michael Niedermayer
68a0477bc0 error_concealment: Check that the picture is not in a half setup state.
Fixes state becoming inconsistent
Fixes a null pointer dereference

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-19 16:18:01 +01:00
Paul B Mahol
ccf0cd967d 012v: remove double ; and return correct error code if ff_get_buffer() fails
Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit 25160236957647d81e8beecd6c8fb7f1949fc26e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-19 16:17:24 +01:00
Michael Niedermayer
002ad7cd39 Merge remote-tracking branch 'qatar/release/9' into release/1.1
* qatar/release/9:
  fate: update ref after rv30_loop_filter fix
  rv30: fix masking in rv30_loop_filter()
  libcdio: support recent cdio-paranoia
  theora: Skip zero-sized headers
  h264: add 3 pixels below for subpixel filter wait position
  h264: fix ff_generate_sliding_window_mmcos() prototype.
  h264: don't clobber mmco opcode tables for non-first slice headers.

Conflicts:
	configure
	libavcodec/h264_refs.c
	tests/ref/fate/filter-delogo
	tests/ref/fate/rv30

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-19 15:54:36 +01:00
Jonas Bechtel
397fafad23 Fix opencv detection.
This commit changes the ".so" argument placement in check_ld sub-program.
(cherry picked from commit a003c5bd4ff1846edba0518306f8091c14041c96)
2013-01-18 10:32:49 +01:00
Michael Niedermayer
30f0cd2f1e h264: fix () placement
Fixes null pointer dereference

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-18 05:14:31 +01:00
Michael Niedermayer
4d6d8d9ae9 rtmpproto: Fix assignments in if()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a601eb9543ecab09aa69a6673e553318daf7ea57)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-18 05:14:31 +01:00
Michael Niedermayer
9348514a67 lavf/mux: Fix assignments in if()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1ac5a8d7e3343718b0e86b44013742b7ca413c38)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-18 05:14:31 +01:00
Michael Niedermayer
17704500fb vsrc_testsrc: Fix assignments in if()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6f88d2d786b87cbfec5ea16d1cb570ad30c80399)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-18 05:14:31 +01:00
Michael Niedermayer
2338eda8d8 tiff: Fix assignments in if()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 659546b42d6550e67fcdbb4937cd1982c60448aa)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-18 05:14:31 +01:00
Michael Niedermayer
6a0633e961 svq1enc: Fix assignments in if()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 37be1d802f2e2c21036a54bb15423a41d5aabefb)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-18 05:14:31 +01:00
Michael Niedermayer
16dc41de27 ra144enc: Fix assignments in if()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e2704381e5f13f54506f69b7a05a05dc27ce1d7d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-18 05:14:31 +01:00
Michael Niedermayer
ab471e17e4 nellymoserenc: Fix assignments in if()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 795d2dc23b16a678d60a681e906aa87c14478597)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-18 05:14:31 +01:00
Michael Niedermayer
3be8aeb14e libvorbisenc: Fix assignments in if()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit bdd71abe5f34ca37612e17d912060f4dc9b94796)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-18 05:14:31 +01:00
Michael Niedermayer
b48e251360 libvo-aacenc: Fix assignments in if()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0ccb31dcad5a1543fbb284d66b0410b91ebd171d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-18 05:14:31 +01:00
Michael Niedermayer
65a4b90840 libspeexenc: Fix assignments in if()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3b8d66d5317d91288751869206b3acbb84dc44c7)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-18 05:14:31 +01:00
Michael Niedermayer
59956a5957 libopencore-amr: Fix assignments in if()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d6180aa29741334cf69f691b27ffceb33f49d36a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-18 05:14:31 +01:00
Michael Niedermayer
d4a08e560d libmp3lame: Fix assignments in if()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 871b6ec01d27a74702b7cf1d61446709de037948)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-18 05:14:31 +01:00
Michael Niedermayer
dacac91973 libfdk-aacenc: Fix assignments in if()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 9302ad1ac89d5443505cf0418f9d62786513032e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-18 05:14:30 +01:00
Michael Niedermayer
d39400fed7 libfaac: Fix assignments in if()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 68a25c64cda16e12ef3a051ff8661c71ef574683)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-18 05:14:30 +01:00
Michael Niedermayer
07174ed841 aacenc: Fix assignments in if()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 98fed59427cec17ce55ac137e7e250cff7db81cf)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-18 05:14:30 +01:00
Michael Niedermayer
e7475335b1 doc/examples: fix assignments in if()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 48a7981e6f93a27c9caca99d0bfb39e6244606a5)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-18 05:14:30 +01:00
Michael Niedermayer
722bfe4e7c swr: fix handling of timestamps that cause multiple drops or silence injections
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d676598f879ba01ddb62f9abe8e17b2e94cb91cd)
2013-01-18 05:14:30 +01:00
Michael Niedermayer
cc8ab98656 mpeg12enc: check dimension validity
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-18 05:14:30 +01:00
Michael Niedermayer
d7cff9f8e8 mpeg12enc: Correctly mask dimensions
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-18 05:14:30 +01:00
Michael Niedermayer
9bfda9df71 mpeg12: Support decoding dimensions that are a multiple of 4096
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-18 05:14:30 +01:00
Luca Barbato
0a837b6317 fate: update ref after rv30_loop_filter fix
(cherry picked from commit 56ef1ef1f7580f41d6819ac63081a02f52752903)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-01-17 23:47:01 +01:00
Xi Wang
c3c1db7c56 rv30: fix masking in rv30_loop_filter()
The mask `x && (1 << y)' is incorrect and always yields true.

The correct form should be `x & (1 << y)'.

CC: libav-stable@libav.org

Signed-off-by: Xi Wang <xi.wang@gmail.com>
(cherry picked from commit 783e37f7ef3b3cdcfe7aa927a25b4184ae46cd53)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-01-17 22:00:01 +01:00
Luca Barbato
21ca4ab944 libcdio: support recent cdio-paranoia
Upstream decided to split the paranoia interface and move the headers
accordingly.
(cherry picked from commit 57224e425c567a87798b66425acc383c6dd37331)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-01-17 21:42:03 +01:00
Martin Storsjö
c749bec8c3 theora: Skip zero-sized headers
This fixes a regression since d9cf5f51/7a2ee770f5 with theora
over RTP (possibly with other variants of theora as well).

In theora over RTP, the second of the 3 headers turns out to be
0 bytes long, which prior to d9cf5f51 worked just fine. After
d9cf5f51, reading from the bitstream reader fails (since the reader
wasn't initialized but returned an error if initialized with 0 bits).

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit e33db35b4a91ad543d9dde3a981a89118ba68937)

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-17 19:11:54 +02:00
Carl Eugen Hoyos
a95306e2d7 Only skip MLP header in mpeg files if the codec actually is MLP.
Fixes PCM audio in Kansas Pheasant Hunt 2000 mpg file.
Reported-by: Mashiat Sarker Shakkhar
(cherry picked from commit ad406f7e402977cb7dbc78ccb63e21c137f6699e)
2013-01-17 17:40:02 +01:00
Carl Eugen Hoyos
ed12d1ecad Fix compilation with --disable-everything.
(cherry picked from commit f023003ce610a8fd6377cf4a8e98002ac3117ef4)
2013-01-17 17:39:00 +01:00
Michael Niedermayer
05ed9b7005 oggparsevorbis: fix vorbis_cleanup return type
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-17 04:34:47 +01:00
Michael Niedermayer
76477c3843 Merge remote-tracking branch 'qatar/release/9' into release/1.1
* qatar/release/9:
  libx264: use the library specific default rc_initial_buffer_occupancy
  lavc: set the default rc_initial_buffer_occupancy
  lavc: introduce the convenience function init_get_bits8
  lavc: check for overflow in init_get_bits
  APIchanges: Fill in missing hashes and dates; fix a version number typo.
  configure: enable pic for shared libs on AArch64
  zmbv: Reset the decoder on keyframe errors
  vc1dec: prevent a crash due missing pred_flag parameter
  matroska: Fix use after free
  vp3: Fix double free in vp3_decode_end()
  update Changelog
  oggdec: make sure the private parse data is cleaned up
  oggdec: free the ogg streams on read_header failure
  update Changelog
  x86: lavr: use the x86inc.asm automatic stack alignment in mixing functions
  Prepare 9.1 Release

Conflicts:
	Changelog
	RELEASE
	doc/APIchanges
	libavcodec/utils.c
	libavformat/oggdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-17 04:26:42 +01:00
Carl Eugen Hoyos
ccc4219558 Fix detection of struct v4l2_frmsize_discrete.
It was always detected successfully.
(cherry picked from commit c345100efc9baae0ea7c9fcc376725cae5d3df6e)
2013-01-17 02:13:40 +01:00
Ronald S. Bultje
9d60f608af h264: add 3 pixels below for subpixel filter wait position
If the motion vector is at a subpixel position, we need 3 pixels below
the motion vector's wholepel position available, not 2, since the MC
filter is a sixtap filter for the hpel position, and then a bilin filter
for the qpel position.

This patch fixes highly irreproducible (0.1%) fate failures in frame 2
and 4 of h264-conformance-cama2_vtc_b (e.g. first P-frame, first field,
last line of MB x=40,y=2 and second field and last lines of MBs x=39-40,
y=3). These used pre-loopfilter instead of post-loopfilter data because
the await_progress() waited for one line too little in that field, and
the motion vector of these particular MBs happened to align exactly to a
position where that demonstrates the bug.

CC: libav-stable@libav.org

(cherry picked from commit fb845ffdd335a1efd6dfd43e8adeb530397b348e)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-01-15 22:20:10 +01:00
Anton Khirnov
6a4803a6a9 h264: fix ff_generate_sliding_window_mmcos() prototype.
It's been returning an error value since
bad446e251405dc250c3cbee199072e083a1e4b9

Also check for the errors it returns.
(cherry picked from commit ea382767ad2191acbe97e90624059723e15f0e4b)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-01-15 22:19:42 +01:00
Ronald S. Bultje
c3b67720f9 h264: don't clobber mmco opcode tables for non-first slice headers.
Clobbering these tables will temporarily clobber the template used
as a basis for other threads to start decoding from. If the other
decoding thread updates from the template right at that moment,
subsequent threads will get invalid (or, usually, none at all) mmco
tables. This leads to invalid reference lists and subsequent decode
failures.

Therefore, instead, decode the mmco tables only for the first slice in
a field or frame. For other slices, decode the bits and ensure they
are identical to the mmco tables in the first slice, but don't ever
clobber the context state. This prevents other threads from using a
clobbered/invalid template as starting point for decoding, and thus
fixes decoding in these cases.

This fixes occasional (~1%) failures of h264-conformance-mr1_bt_a with
frame-multithreading enabled.

(cherry picked from commit bad446e251405dc250c3cbee199072e083a1e4b9)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-01-15 22:19:07 +01:00
Michael Niedermayer
1c373456f6 oggdec: Leave treatment of serial changes to the decoder.
Attempting to re-parse the headers at demuxer level is a
pandora box the way its done currently.

This allows full reconfiguration of vorbis streams

Fixes Ticket2117
Fixes Ticket2121

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c994bb2fb7727f5c20ef71cc6727fb219fd49d60)
2013-01-15 21:12:03 +01:00
Michael Niedermayer
9636266cbd vorbisdec: handle midstream parameter changes
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e9ffee23f372390684d6d94bf8abf51350fc66a3)
2013-01-15 21:12:03 +01:00
Michael Niedermayer
dc3349024a vorbisdec: support freeing partially allocated contexts.
Fixes null pointer derefernces

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 778069c8325514518712d194749577b3451b4125)
2013-01-15 21:12:03 +01:00
Michael Niedermayer
66a3112100 oggdec: resync from the last page.
Previously we re synced from where we where which cam lead
to loosing pages.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c5cf58d4b9b04cee1487a3095b83300791c21f15)
2013-01-15 21:12:03 +01:00
Luca Barbato
72eca26bf9 libx264: use the library specific default rc_initial_buffer_occupancy
By default libav sets it to 3/4 while x264 sets it to 9/10.

CC: libav-stable@libav.org

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

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-01-15 09:12:46 +01:00
Luca Barbato
e44d56b18d lavc: set the default rc_initial_buffer_occupancy
rc_buffer_size is not set before.

Solve the initial the rate control underflow issue reported in
bug 222.

CC: libav-stable@libav.org

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

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-01-15 09:12:41 +01:00
Luca Barbato
71e00caeab lavc: introduce the convenience function init_get_bits8
Accept the buffer size in bytes and check for overflow before passing
the value in bits to init_get_bits.
(cherry picked from commit e28ac6e5e27e64a206e399e958481c1e6f992189)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-01-14 05:22:22 +01:00
Luca Barbato
7a2ee770f5 lavc: check for overflow in init_get_bits
Fix an undefined behaviour and make the function return a proper
error in case of overflow.

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

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-01-14 05:21:57 +01:00
Diego Biurrun
fadebd256e APIchanges: Fill in missing hashes and dates; fix a version number typo. 2013-01-12 12:59:25 +01:00
André Pankratz
3dab6e5429 lavfi/yadif: fix shorthand/option mismatch
Fix trac ticket #2128.

Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
(cherry picked from commit 0287eea914307a3fa03fa0d117af2955de0a4a2f)
2013-01-12 02:34:06 +01:00
Marcin Juszkiewicz
bc182a6aca configure: enable pic for shared libs on AArch64
Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit d11cb13b0ef02fb1c303b29805819f6e1c9dc61b)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-01-11 13:02:44 +01:00
Luca Barbato
fbde7b2d0a zmbv: Reset the decoder on keyframe errors
Prevent the crash on fuzzed files as reported in bug 63.
(cherry picked from commit c1d1ef4ecd9c4f1ca01c8149c7e57c14968ca588)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-01-11 12:42:56 +01:00
Vladimir Pantelic
58baa367d6 vc1dec: prevent a crash due missing pred_flag parameter
Handle pred_flag parameter not given to get_mvdata_interlaced()

Signed-off-by: Vladimir Pantelic <vladoman@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 7b8c5b263bc680eff5710bee5994de39d47fc15e)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-01-11 12:42:56 +01:00
Dale Curtis
ca2e3f1131 matroska: Fix use after free
Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit ae3d41636942cbc0236bad21ad06c65f4eb0f096)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-01-11 02:17:19 +01:00
Ronald Bultje
ebd3aa429c vp3: Fix double free in vp3_decode_end()
Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit ec86ba57312745fd7ad9771e3121e79c6aacba30)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-01-11 02:17:09 +01:00
Michael Niedermayer
ddb0317154 dirac: fix inverted check
Regression since: ea6da80
Fixes Ticket2123

I cannot reproduce any regressions by flipping the wrong condition
to how it should have been.

Thanks-to: ubitux
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 57bdd67646cfffa2921a8b28bb5f88cfe5c0989e)
2013-01-09 09:48:49 +01:00
Clément Bœsch
606aa3baee lavf/mux: do not pass a copy of the packet to write_packet().
Sometimes the muxer modifies the packet, like for instance lavf/mp3enc
changing pkt->destruct in order to keep a copy. These changes must be
kept, even though the muxer behaviour is questionable. Regression since
0072116.

Fixes #2124.
(cherry picked from commit 119d70db5099f9513d954283245efd7f699ad321)
2013-01-08 23:26:49 +01:00
Carl Eugen Hoyos
36dac6da41 Add forgotten AVC Intra entry to Changelog.
(cherry picked from commit b23aff6755ff96b3b338e4b5f9eb3b6a91fda433)
2013-01-08 23:26:36 +01:00
Paul B Mahol
9202824e1b Changelog: move Megalux where it belongs
Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit e13c5abbd70440a02e00d7392738a36356481a78)
2013-01-08 23:26:19 +01:00
Reinhard Tartler
0135dd73bb update Changelog 2013-01-07 11:14:31 +01:00
Luca Barbato
c01be297ce oggdec: make sure the private parse data is cleaned up
(cherry picked from commit d894f74762bc95310ba23f804b7ba8dffc8f6646)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-01-07 09:00:09 +01:00
Luca Barbato
42bd6d9cf6 oggdec: free the ogg streams on read_header failure
Plug an annoying memory leak on broken files.
(cherry picked from commit 89b51b570daa80e6e3790fcd449fe61fc5574e07)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-01-07 09:00:04 +01:00
Michael Niedermayer
79013a59c0 update for 1.1
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-06 22:42:56 +01:00
Reinhard Tartler
c1555ae4b6 update Changelog 2013-01-06 18:05:04 +01:00
Justin Ruggles
a557005417 x86: lavr: use the x86inc.asm automatic stack alignment in mixing functions
CC:libav-stable@libav.org
(cherry picked from commit 95d01c3f1c33c079db04e24133ba4a6b00d62d4a)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2013-01-06 15:46:12 +01:00
Reinhard Tartler
8069b44ebf Prepare 9.1 Release 2013-01-06 15:45:51 +01:00
424 changed files with 7509 additions and 5242 deletions

1054
Changelog

File diff suppressed because it is too large Load Diff

View File

@ -14,7 +14,6 @@ and related discussions.
Project Leader
==============
Michael Niedermayer
final design decisions
@ -445,10 +444,11 @@ x86 Michael Niedermayer
Releases
========
1.2 Michael Niedermayer
1.1 Michael Niedermayer
1.0 Michael Niedermayer
0.11 Michael Niedermayer
If you want to maintain an older release, please contact us
GnuPG Fingerprints of maintainers and contributors

View File

@ -1 +1 @@
1.1.git
1.1.16

View File

@ -65,7 +65,7 @@ struct SwsContext *sws_opts;
SwrContext *swr_opts;
AVDictionary *format_opts, *codec_opts;
const int this_year = 2013;
const int this_year = 2015;
static FILE *report_file;
@ -1851,7 +1851,7 @@ static int alloc_buffer(FrameBuffer **pool, AVCodecContext *s, FrameBuffer **pbu
/* XXX this shouldn't be needed, but some tests break without this line
* those decoders are buggy and need to be fixed.
* the following tests fail:
* cdgraphics, ansi, aasc, fraps-v1, qtrle-1bit
* cdgraphics, ansi
*/
memset(buf->base[0], 128, ret);

View File

@ -190,13 +190,13 @@ void show_help_options(const OptionDef *options, const char *msg, int req_flags,
void show_help_children(const AVClass *class, int flags);
/**
* Per-avtool specific help handler. Implemented in each
* avtool, called by show_help().
* Per-fftool specific help handler. Implemented in each
* fftool, called by show_help().
*/
void show_help_default(const char *opt, const char *arg);
/**
* Generic -h handler common to all avtools.
* Generic -h handler common to all fftools.
*/
int show_help(void *optctx, const char *opt, const char *arg);

99
configure vendored
View File

@ -789,14 +789,21 @@ check_ld(){
log check_ld "$@"
type=$1
shift 1
flags=$(filter_out '-l*' $@)
libs=$(filter '-l*' $@)
flags=$(filter_out '-l*|*.so' $@)
libs=$(filter '-l*|*.so' $@)
check_$type $($cflags_filter $flags) || return
flags=$($ldflags_filter $flags)
libs=$($ldflags_filter $libs)
check_cmd $ld $LDFLAGS $flags $(ld_o $TMPE) $TMPO $libs $extralibs
}
print_include(){
hdr=$1
test "${hdr%.h}" = "${hdr}" &&
echo "#include $hdr" ||
echo "#include <$hdr>"
}
check_code(){
log check_code "$@"
check=$1
@ -805,7 +812,7 @@ check_code(){
shift 3
{
for hdr in $headers; do
echo "#include <$hdr>"
print_include $hdr
done
echo "int main(void) { $code; return 0; }"
} | check_$check "$@"
@ -889,7 +896,7 @@ check_func_headers(){
shift 2
{
for hdr in $headers; do
echo "#include <$hdr>"
print_include $hdr
done
for func in $funcs; do
echo "long check_$func(void) { return (long) $func; }"
@ -1053,6 +1060,26 @@ require_pkg_config(){
add_extralibs $(get_safe ${pkg}_libs)
}
require_libfreetype(){
log require_libfreetype "$@"
pkg="freetype2"
check_cmd $pkg_config --exists --print-errors $pkg \
|| die "ERROR: $pkg not found"
pkg_cflags=$($pkg_config --cflags $pkg)
pkg_libs=$($pkg_config --libs $pkg)
{
echo "#include <ft2build.h>"
echo "#include FT_FREETYPE_H"
echo "long check_func(void) { return (long) FT_Init_FreeType; }"
echo "int main(void) { return 0; }"
} | check_ld "cc" $pkg_cflags $pkg_libs \
&& set_safe ${pkg}_cflags $pkg_cflags \
&& set_safe ${pkg}_libs $pkg_libs \
|| die "ERROR: $pkg not found"
add_cflags $(get_safe ${pkg}_cflags)
add_extralibs $(get_safe ${pkg}_libs)
}
hostcc_o(){
eval printf '%s\\n' $HOSTCC_O
}
@ -1338,11 +1365,14 @@ HAVE_LIST="
alsa_asoundlib_h
altivec_h
arpa_inet_h
as_object_arch
asm_mod_q
asm_mod_y
asm_types_h
attribute_may_alias
attribute_packed
cdio_paranoia_h
cdio_paranoia_paranoia_h
clock_gettime
closesocket
cmov
@ -1464,6 +1494,7 @@ HAVE_LIST="
CONFIG_EXTRA="
aandcttables
ac3dsp
audio_frame_queue
error_resilience
gcrypt
golomb
@ -1631,7 +1662,7 @@ mpegvideoenc_select="mpegvideo"
# decoders / encoders
aac_decoder_select="mdct sinewin"
aac_encoder_select="mdct sinewin"
aac_encoder_select="audio_frame_queue mdct sinewin"
aac_latm_decoder_select="aac_decoder aac_latm_parser"
ac3_decoder_select="mdct ac3dsp ac3_parser"
ac3_encoder_select="mdct ac3dsp"
@ -1716,13 +1747,13 @@ msmpeg4v3_decoder_select="h263_decoder"
msmpeg4v3_encoder_select="h263_encoder"
mss2_decoder_select="vc1_decoder"
nellymoser_decoder_select="mdct sinewin"
nellymoser_encoder_select="mdct sinewin"
nellymoser_encoder_select="audio_frame_queue mdct sinewin"
nuv_decoder_select="lzo"
png_decoder_select="zlib"
png_encoder_select="zlib"
qcelp_decoder_select="lsp"
qdm2_decoder_select="mdct rdft mpegaudiodsp"
ra_144_encoder_select="lpc"
ra_144_encoder_select="audio_frame_queue lpc"
ralf_decoder_select="golomb"
rv10_decoder_select="h263_decoder"
rv10_encoder_select="h263_encoder"
@ -1732,7 +1763,7 @@ rv30_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpegvi
rv40_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpegvideo"
shorten_decoder_select="golomb"
sipr_decoder_select="lsp"
snow_decoder_select="dwt rangecoder"
snow_decoder_select="dwt rangecoder videodsp"
snow_encoder_select="aandcttables dwt error_resilience mpegvideoenc rangecoder"
sonic_decoder_select="golomb"
sonic_encoder_select="golomb"
@ -1778,14 +1809,15 @@ zmbv_encoder_select="zlib"
# hardware accelerators
crystalhd_deps="libcrystalhd_libcrystalhd_if_h"
dxva2_deps="dxva2api_h"
vaapi_deps="va_va_h"
vda_deps="VideoDecodeAcceleration_VDADecoder_h pthreads"
vdpau_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
h263_vaapi_hwaccel_select="vaapi h263_decoder"
h264_crystalhd_decoder_select="crystalhd h264_mp4toannexb_bsf h264_parser"
h264_dxva2_hwaccel_deps="dxva2api_h"
h264_dxva2_hwaccel_select="dxva2 h264_decoder"
h264_dxva2_hwaccel_deps="dxva2"
h264_dxva2_hwaccel_select="h264_decoder"
h264_vaapi_hwaccel_select="vaapi h264_decoder"
h264_vda_decoder_select="vda h264_parser h264_decoder"
h264_vda_hwaccel_deps="VideoDecodeAcceleration_VDADecoder_h pthreads"
@ -1795,8 +1827,8 @@ mpeg_vdpau_decoder_select="vdpau mpegvideo_decoder"
mpeg1_vdpau_decoder_select="vdpau mpeg1video_decoder"
mpeg1_vdpau_hwaccel_select="vdpau mpeg1video_decoder"
mpeg2_crystalhd_decoder_select="crystalhd"
mpeg2_dxva2_hwaccel_deps="dxva2api_h"
mpeg2_dxva2_hwaccel_select="dxva2 mpeg2video_decoder"
mpeg2_dxva2_hwaccel_deps="dxva2"
mpeg2_dxva2_hwaccel_select="mpeg2video_decoder"
mpeg2_vdpau_hwaccel_select="vdpau mpeg2video_decoder"
mpeg2_vaapi_hwaccel_select="vaapi mpeg2video_decoder"
mpeg4_crystalhd_decoder_select="crystalhd"
@ -1804,8 +1836,8 @@ mpeg4_vaapi_hwaccel_select="vaapi mpeg4_decoder"
mpeg4_vdpau_decoder_select="vdpau mpeg4_decoder"
msmpeg4_crystalhd_decoder_select="crystalhd"
vc1_crystalhd_decoder_select="crystalhd"
vc1_dxva2_hwaccel_deps="dxva2api_h"
vc1_dxva2_hwaccel_select="dxva2 vc1_decoder"
vc1_dxva2_hwaccel_deps="dxva2"
vc1_dxva2_hwaccel_select="vc1_decoder"
vc1_vaapi_hwaccel_select="vaapi vc1_decoder"
vc1_vdpau_decoder_select="vdpau vc1_decoder"
wmv3_crystalhd_decoder_select="crystalhd"
@ -1823,7 +1855,9 @@ vc1_parser_select="error_resilience mpegvideo"
libaacplus_encoder_deps="libaacplus"
libcelt_decoder_deps="libcelt"
libfaac_encoder_deps="libfaac"
libfaac_encoder_select="audio_frame_queue"
libfdk_aac_encoder_deps="libfdk_aac"
libfdk_aac_encoder_select="audio_frame_queue"
libgsm_decoder_deps="libgsm"
libgsm_encoder_deps="libgsm"
libgsm_ms_decoder_deps="libgsm"
@ -1832,24 +1866,30 @@ libilbc_decoder_deps="libilbc"
libilbc_encoder_deps="libilbc"
libmodplug_demuxer_deps="libmodplug"
libmp3lame_encoder_deps="libmp3lame"
libmp3lame_encoder_select="audio_frame_queue"
libopencore_amrnb_decoder_deps="libopencore_amrnb"
libopencore_amrnb_encoder_deps="libopencore_amrnb"
libopencore_amrnb_encoder_select="audio_frame_queue"
libopencore_amrwb_decoder_deps="libopencore_amrwb"
libopenjpeg_decoder_deps="libopenjpeg"
libopenjpeg_encoder_deps="libopenjpeg"
libopus_decoder_deps="libopus"
libopus_encoder_deps="libopus"
libopus_encoder_select="audio_frame_queue"
libschroedinger_decoder_deps="libschroedinger"
libschroedinger_encoder_deps="libschroedinger"
libspeex_decoder_deps="libspeex"
libspeex_encoder_deps="libspeex"
libspeex_encoder_select="audio_frame_queue"
libstagefright_h264_decoder_deps="libstagefright_h264"
libtheora_encoder_deps="libtheora"
libtwolame_encoder_deps="libtwolame"
libvo_aacenc_encoder_deps="libvo_aacenc"
libvo_aacenc_encoder_select="audio_frame_queue"
libvo_amrwbenc_encoder_deps="libvo_amrwbenc"
libvorbis_decoder_deps="libvorbis"
libvorbis_encoder_deps="libvorbis"
libvorbis_encoder_select="audio_frame_queue"
libvpx_decoder_deps="libvpx"
libvpx_encoder_deps="libvpx"
libx264_encoder_deps="libx264"
@ -2088,6 +2128,9 @@ enable safe_bitstream_reader
enable static
enable swscale_alpha
# By default, enable only those hwaccels that have no external dependencies.
enable dxva2 vdpau
# build settings
SHFLAGS='-shared -Wl,-soname,$$(@F)'
FFSERVERLDFLAGS=-Wl,-E
@ -2545,7 +2588,9 @@ probe_cc(){
unset _depflags _DEPCMD _DEPFLAGS
_flags_filter=echo
if $_cc -v 2>&1 | grep -q '^gcc.*LLVM'; then
if $_cc --version 2>&1 | grep -q '^GNU assembler'; then
true # no-op to avoid reading stdin in following checks
elif $_cc -v 2>&1 | grep -q '^gcc.*LLVM'; then
_type=llvm_gcc
gcc_extra_ver=$(expr "$($_cc --version | head -n1)" : '.*\((.*)\)')
_ident="llvm-gcc $($_cc -dumpversion) $gcc_extra_ver"
@ -3076,7 +3121,7 @@ check_64bit(){
}
case "$arch" in
alpha|ia64)
aarch64|alpha|ia64)
spic=$shared
;;
mips)
@ -3091,6 +3136,10 @@ case "$arch" in
check_64bit ppc ppc64 'sizeof(void *) > 4'
spic=$shared
;;
s390)
check_64bit s390 s390x 'sizeof(void *) > 4'
spic=$shared
;;
sparc)
check_64bit sparc sparc64 'sizeof(void *) > 4'
spic=$shared
@ -3516,6 +3565,11 @@ EOF
enabled_all armv6t2 shared !pic && enable_pic
# llvm's integrated assembler supports .object_arch from llvm 3.5
[ "$objformat" = elf ] && check_as <<EOF && enable as_object_arch
.object_arch armv4
EOF
elif enabled mips; then
check_inline_asm loongson '"dmult.g $1, $2, $3"'
@ -3643,6 +3697,7 @@ EOF
fi
check_ldflags -Wl,--as-needed
check_ldflags -Wl,-z,noexecstack
if check_func dlopen; then
ldl=
@ -3816,8 +3871,7 @@ enabled gnutls && require_pkg_config gnutls gnutls/gnutls.h gnutls_global_in
enabled libiec61883 && require libiec61883 libiec61883/iec61883.h iec61883_cmp_connect -lraw1394 -lavc1394 -lrom1394 -liec61883
enabled libaacplus && require "libaacplus >= 2.0.0" aacplus.h aacplusEncOpen -laacplus
enabled libass && require_pkg_config libass ass/ass.h ass_library_init
enabled libbluray && require libbluray libbluray/bluray.h bd_open -lbluray
enabled libcdio && require2 libcdio "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio
enabled libbluray && require_pkg_config libbluray libbluray/bluray.h bd_open
enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 &&
{ check_lib celt/celt.h celt_decoder_create_custom -lcelt0 ||
die "ERROR: libcelt must be installed and version must be >= 0.11.0."; }
@ -3826,7 +3880,7 @@ enabled libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaa
enabled libfdk_aac && require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac
flite_libs="-lflite_cmu_time_awb -lflite_cmu_us_awb -lflite_cmu_us_kal -lflite_cmu_us_kal16 -lflite_cmu_us_rms -lflite_cmu_us_slt -lflite_usenglish -lflite_cmulex -lflite"
enabled libflite && require2 libflite "flite/flite.h" flite_init $flite_libs
enabled libfreetype && require_pkg_config freetype2 "ft2build.h freetype/freetype.h" FT_Init_FreeType
enabled libfreetype && require_libfreetype
enabled libgsm && require libgsm gsm/gsm.h gsm_create -lgsm
enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc
enabled libmodplug && require libmodplug libmodplug/modplug.h ModPlug_Load -lmodplug
@ -3916,7 +3970,7 @@ rsync --help 2> /dev/null | grep -q 'contimeout' && enable rsync_contimeout || d
check_header linux/fb.h
check_header linux/videodev.h
check_header linux/videodev2.h
check_struct linux/videodev2.h "struct v4l2_frmivalenum" discrete
check_code cc linux/videodev2.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_safe struct_v4l2_frmivalenum_discrete
check_header sys/videoio.h
@ -3954,6 +4008,9 @@ enabled jack_indev && check_lib2 jack/jack.h jack_client_open -ljack && check_fu
enabled_any sndio_indev sndio_outdev && check_lib2 sndio.h sio_open -lsndio
if enabled libcdio; then
check_lib2 "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio || check_lib2 "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio
fi
enabled x11grab &&
require X11 X11/Xlib.h XOpenDisplay -lX11 &&
@ -4090,6 +4147,7 @@ elif enabled gcc; then
check_optflags -fno-tree-vectorize
check_cflags -Werror=implicit-function-declaration
check_cflags -Werror=missing-prototypes
check_cflags -Werror=return-type
check_cflags -Werror=vla
elif enabled llvm_gcc; then
check_cflags -mllvm -stack-alignment=16
@ -4098,6 +4156,7 @@ elif enabled clang; then
check_cflags -Qunused-arguments
check_cflags -Werror=implicit-function-declaration
check_cflags -Werror=missing-prototypes
check_cflags -Werror=return-type
elif enabled armcc; then
# 2523: use of inline assembler is deprecated
add_cflags -W${armcc_opt},--diag_suppress=2523

View File

@ -132,30 +132,30 @@ API changes, most recent first:
2012-03-26 - a67d9cf - lavfi 2.66.100
Add avfilter_fill_frame_from_{audio_,}buffer_ref() functions.
2012-xx-xx - xxxxxxx - lavu 52.2.1 - avstring.h
2012-12-29 - 2ce43b3 / d8fd06c - lavu 52.13.100 / 52.3.0 - avstring.h
Add av_basename() and av_dirname().
2012-11-10 - 5980f5dd - lavu 52.2.0 - audioconvert.h
2012-11-11 - 03b0787 / 5980f5d - lavu 52.6.100 / 52.2.0 - audioconvert.h
Rename audioconvert.h to channel_layout.h. audioconvert.h is now deprecated.
2012-10-26 - dfde8a34 - lavu 52.1.0 - intmath.h
Add av_ctz() for trailing zero bit count.
2012-11-05 - 7d26be6 / dfde8a3 - lavu 52.5.100 / 52.1.0 - intmath.h
Add av_ctz() for trailing zero bit count
2012-10-18 - a893655b - lavu 51.45.0 - error.h
Add AVERROR_EXPERIMENTAL.
2012-10-21 - e3a91c5 / a893655 - lavu 51.77.100 / 51.45.0 - error.h
Add AVERROR_EXPERIMENTAL
2012-10-12 - d2fcb356 - lavu 51.44.0 - pixdesc.h
2012-10-12 - a33ed6b / d2fcb35 - lavu 51.76.100 / 51.44.0 - pixdesc.h
Add functions for accessing pixel format descriptors.
Accessing the av_pix_fmt_descriptors array directly is now
deprecated.
2012-10-11 - 9a92aea2 - lavu 51.43.0 - aes.h, md5.h, sha.h, tree.h
2012-10-11 - f391e40 / 9a92aea - lavu 51.75.100 / 51.43.0 - aes.h, md5.h, sha.h, tree.h
Add functions for allocating the opaque contexts for the algorithms,
2012-10-10 - b522000e - lavf 54.18.0 - avio.h
2012-10-10 - de31814 / b522000 - lavf 54.32.100 / 54.18.0 - avio.h
Add avio_closep to complement avio_close.
2012-10-06 - 78071a14 - lavu 51.42.0 - pixfmt.h
2012-10-08 - ae77266 / 78071a1 - lavu 51.74.100 / 51.42.0 - pixfmt.h
Rename PixelFormat to AVPixelFormat and all PIX_FMT_* to AV_PIX_FMT_*.
To provide backwards compatibility, PixelFormat is now #defined as
AVPixelFormat.
@ -163,23 +163,23 @@ API changes, most recent first:
'PixelFormat' identifier. Such code should either #undef PixelFormat
or stop using the PixelFormat name.
2012-10-05 - e7ba5b1 - lavr 1.0.0 - avresample.h
2012-10-05 - 55c49af / e7ba5b1 - lavr 1.0.0 - avresample.h
Data planes parameters to avresample_convert() and
avresample_read() are now uint8_t** instead of void**.
Libavresample is now stable.
2012-09-24 - a42aada - lavc 54.28.0 - avcodec.h
2012-09-24 - 46a3595 / a42aada - lavc 54.59.100 / 54.28.0 - avcodec.h
Add avcodec_free_frame(). This function must now
be used for freeing an AVFrame.
2012-09-12 - 8919fee - lavu 51.41.0 - audioconvert.h
2012-09-12 - e3e09f2 / 8919fee - lavu 51.73.100 / 51.41.0 - audioconvert.h
Added AV_CH_LOW_FREQUENCY_2 channel mask value.
2012-09-04 - 686a329 - lavu 51.40.0 - opt.h
2012-09-04 - b21b5b0 / 686a329 - lavu 51.71.100 / 51.40.0 - opt.h
Reordered the fields in default_val in AVOption, changed which
default_val field is used for which AVOptionType.
2012-08-30 - a231832 - lavc 54.26.1 - avcodec.h
2012-08-30 - 98298eb / a231832 - lavc 54.54.101 / 54.26.1 - avcodec.h
Add codec descriptor properties AV_CODEC_PROP_LOSSY and
AV_CODEC_PROP_LOSSLESS.
@ -187,90 +187,90 @@ API changes, most recent first:
Add codec descriptors for accessing codec properties without having
to refer to a specific decoder or encoder.
c223d79 - Add an AVCodecDescriptor struct and functions
f5f3684 / c223d79 - Add an AVCodecDescriptor struct and functions
avcodec_descriptor_get() and avcodec_descriptor_next().
51efed1 - Add AVCodecDescriptor.props and AV_CODEC_PROP_INTRA_ONLY.
91e59fe - Add avcodec_descriptor_get_by_name().
f5f3684 / 51efed1 - Add AVCodecDescriptor.props and AV_CODEC_PROP_INTRA_ONLY.
6c180b3 / 91e59fe - Add avcodec_descriptor_get_by_name().
2012-08-08 - 987170c - lavu 51.38 - dict.h
2012-08-08 - f5f3684 / 987170c - lavu 51.68.100 / 51.38.0 - dict.h
Add av_dict_count().
2012-08-07 - 104e10f - lavc 54.25 - avcodec.h
2012-08-07 - 7a72695 / 104e10f - lavc 54.51.100 / 54.25.0 - avcodec.h
Rename CodecID to AVCodecID and all CODEC_ID_* to AV_CODEC_ID_*.
To provide backwards compatibility, CodecID is now #defined as AVCodecID.
Note that this can break user code that includes avcodec.h and uses the
'CodecID' identifier. Such code should either #undef CodecID or stop using the
CodecID name.
2012-08-03 - 239fdf1 - lavu 51.37.1 - cpu.h
2012-08-03 - e776ee8 / 239fdf1 - lavu 51.66.101 / 51.37.1 - cpu.h
lsws 2.1.1 - swscale.h
Rename AV_CPU_FLAG_MMX2 ---> AV_CPU_FLAG_MMXEXT.
Rename SWS_CPU_CAPS_MMX2 ---> SWS_CPU_CAPS_MMXEXT.
2012-07-29 - 681ed00 - lavf 54.13.0 - avformat.h
2012-07-29 - 7c26761 / 681ed00 - lavf 54.22.100 / 54.13.0 - avformat.h
Add AVFMT_FLAG_NOBUFFER for low latency use cases.
2012-07-10 - 5fade8a - lavu 51.37.0
Add av_malloc_array() and av_mallocz_array()
2012-06-22 - d3d3a32 - lavu 51.34.0
2012-06-22 - e847f41 / d3d3a32 - lavu 51.61.100 / 51.34.0
Add av_usleep()
2012-06-20 - ae0a301 - lavu 51.33.0
2012-06-20 - 4da42eb / ae0a301 - lavu 51.60.100 / 51.33.0
Move av_gettime() to libavutil, add libavutil/time.h
2012-06-09 - 3971be0 - lavr 0.0.3
2012-06-09 - 82edf67 / 3971be0 - lavr 0.0.3
Add a parameter to avresample_build_matrix() for Dolby/DPLII downmixing.
2012-06-12 - 9baeff9 - lavfi 2.23.0 - avfilter.h
2012-06-12 - c7b9eab / 9baeff9 - lavfi 2.79.100 / 2.23.0 - avfilter.h
Add AVFilterContext.nb_inputs/outputs. Deprecate
AVFilterContext.input/output_count.
2012-06-12 - 84b9fbe - lavfi 2.22.0 - avfilter.h
2012-06-12 - c7b9eab / 84b9fbe - lavfi 2.79.100 / 2.22.0 - avfilter.h
Add avfilter_pad_get_type() and avfilter_pad_get_name(). Those
should now be used instead of accessing AVFilterPad members
directly.
2012-06-12 - b0f0dfc - lavu 51.32.0 - audioconvert.h
2012-06-12 - 3630a07 / b0f0dfc - lavu 51.57.100 / 51.32.0 - audioconvert.h
Add av_get_channel_layout_channel_index(), av_get_channel_name()
and av_channel_layout_extract_channel().
2012-05-25 - 154486f - lavu 51.31.0 - opt.h
2012-05-25 - 53ce990 / 154486f - lavu 51.55.100 / 51.31.0 - opt.h
Add av_opt_set_bin()
2012-05-15 - lavfi 2.17.0
2012-05-15 - lavfi 2.74.100 / 2.17.0
Add support for audio filters
ac71230/a2cd9be - add video/audio buffer sink in a new installed
61930bd / ac71230, 1cbf7fb / a2cd9be - add video/audio buffer sink in a new installed
header buffersink.h
720c6b7 - add av_buffersrc_write_frame(), deprecate
1cbf7fb / 720c6b7 - add av_buffersrc_write_frame(), deprecate
av_vsrc_buffer_add_frame()
ab16504 - add avfilter_copy_buf_props()
9453c9e - add extended_data to AVFilterBuffer
1b8c927 - add avfilter_get_audio_buffer_ref_from_arrays()
61930bd / ab16504 - add avfilter_copy_buf_props()
61930bd / 9453c9e - add extended_data to AVFilterBuffer
61930bd / 1b8c927 - add avfilter_get_audio_buffer_ref_from_arrays()
2012-05-09 - lavu 51.30.0 - samplefmt.h
142e740 - add av_samples_copy()
6d7f617 - add av_samples_set_silence()
2012-05-09 - lavu 51.53.100 / 51.30.0 - samplefmt.h
61930bd / 142e740 - add av_samples_copy()
61930bd / 6d7f617 - add av_samples_set_silence()
2012-05-09 - a5117a2 - lavc 54.13.1
2012-05-09 - 61930bd / a5117a2 - lavc 54.21.101 / 54.13.1
For audio formats with fixed frame size, the last frame
no longer needs to be padded with silence, libavcodec
will handle this internally (effectively all encoders
behave as if they had CODEC_CAP_SMALL_LAST_FRAME set).
2012-05-07 - 828bd08 - lavc 54.13.0 - avcodec.h
2012-05-07 - 653d117 / 828bd08 - lavc 54.20.100 / 54.13.0 - avcodec.h
Add sample_rate and channel_layout fields to AVFrame.
2012-05-01 - 4010d72 - lavr 0.0.1
2012-05-01 - 2330eb1 / 4010d72 - lavr 0.0.1
Change AV_MIX_COEFF_TYPE_Q6 to AV_MIX_COEFF_TYPE_Q8.
2012-04-25 - 3527a73 - lavu 51.29.0 - cpu.h
2012-04-25 - e890b68 / 3527a73 - lavu 51.48.100 / 51.29.0 - cpu.h
Add av_parse_cpu_flags()
2012-04-24 - c8af852 - lavr 0.0.0
2012-04-24 - 3ead79e / c8af852 - lavr 0.0.0
Add libavresample audio conversion library
2012-04-20 - 0c0d1bc - lavu 51.28.0 - audio_fifo.h
2012-04-20 - 3194ab7 / 0c0d1bc - lavu 51.47.100 / 51.28.0 - audio_fifo.h
Add audio FIFO functions:
av_audio_fifo_free()
av_audio_fifo_alloc()
@ -282,10 +282,10 @@ API changes, most recent first:
av_audio_fifo_size()
av_audio_fifo_space()
2012-04-14 - lavfi 2.16.0 - avfiltergraph.h
d7bcc71 Add avfilter_graph_parse2().
2012-04-14 - lavfi 2.70.100 / 2.16.0 - avfiltergraph.h
7432bcf / d7bcc71 Add avfilter_graph_parse2().
2012-04-08 - 4d693b0 - lavu 51.27.0 - samplefmt.h
2012-04-08 - 6bfb304 / 4d693b0 - lavu 51.46.100 / 51.27.0 - samplefmt.h
Add av_get_packed_sample_fmt() and av_get_planar_sample_fmt()
2012-03-21 - b75c67d - lavu 51.43.100
@ -313,73 +313,73 @@ API changes, most recent first:
2012-01-24 - 0c3577b - lavfi 2.60.100
Add avfilter_graph_dump.
2012-03-20 - 3c90cc2 - lavfo 54.2.0
2012-03-20 - 0ebd836 / 3c90cc2 - lavfo 54.2.0
Deprecate av_read_packet(), use av_read_frame() with
AVFMT_FLAG_NOPARSE | AVFMT_FLAG_NOFILLIN in AVFormatContext.flags
2012-03-05 - lavc 54.8.0
6699d07 Add av_get_exact_bits_per_sample()
9524cf7 Add av_get_audio_frame_duration()
2012-03-05 - lavc 54.10.100 / 54.8.0
f095391 / 6699d07 Add av_get_exact_bits_per_sample()
f095391 / 9524cf7 Add av_get_audio_frame_duration()
2012-03-04 - 44fe77b - lavc 54.7.0 - avcodec.h
2012-03-04 - 2af8f2c / 44fe77b - lavc 54.8.100 / 54.7.0 - avcodec.h
Add av_codec_is_encoder/decoder().
2012-03-01 - 442c132 - lavc 54.3.0 - avcodec.h
2012-03-01 - 1eb7f39 / 442c132 - lavc 54.5.100 / 54.3.0 - avcodec.h
Add av_packet_shrink_side_data.
2012-02-29 - dd2a4bc - lavf 54.2.0 - avformat.h
2012-02-29 - 79ae084 / dd2a4bc - lavf 54.2.100 / 54.2.0 - avformat.h
Add AVStream.attached_pic and AV_DISPOSITION_ATTACHED_PIC,
used for dealing with attached pictures/cover art.
2012-02-25 - c9bca80 - lavu 51.24.0 - error.h
2012-02-25 - 305e4b3 / c9bca80 - lavu 51.41.100 / 51.24.0 - error.h
Add AVERROR_UNKNOWN
NOTE: this was backported to 0.8
2012-02-20 - e9cda85 - lavc 54.2.0
2012-02-20 - eadd426 / e9cda85 - lavc 54.2.100 / 54.2.0
Add duration field to AVCodecParserContext
2012-02-20 - 0b42a93 - lavu 51.23.1 - mathematics.h
2012-02-20 - eadd426 / 0b42a93 - lavu 51.40.100 / 51.23.1 - mathematics.h
Add av_rescale_q_rnd()
2012-02-08 - 38d5533 - lavu 51.22.1 - pixdesc.h
2012-02-08 - f2b20b7 / 38d5533 - lavu 51.38.101 / 51.22.1 - pixdesc.h
Add PIX_FMT_PSEUDOPAL flag.
2012-02-08 - 52f82a1 - lavc 54.01.0
2012-02-08 - f2b20b7 / 52f82a1 - lavc 54.2.100 / 54.1.0
Add avcodec_encode_video2() and deprecate avcodec_encode_video().
2012-02-01 - 316fc74 - lavc 54.01.0
2012-02-01 - 4c677df / 316fc74 - lavc 54.1.0
Add av_fast_padded_malloc() as alternative for av_realloc() when aligned
memory is required. The buffer will always have FF_INPUT_BUFFER_PADDING_SIZE
zero-padded bytes at the end.
2012-01-31 - dd6d3b0 - lavf 54.01.0
2012-01-31 - a369a6b / dd6d3b0 - lavf 54.1.0
Add avformat_get_riff_video_tags() and avformat_get_riff_audio_tags().
NOTE: this was backported to 0.8
2012-01-31 - af08d9a - lavc 54.01.0
2012-01-31 - a369a6b / af08d9a - lavc 54.1.0
Add avcodec_is_open() function.
NOTE: this was backported to 0.8
2012-01-30 - 8b93312 - lavu 51.22.0 - intfloat.h
2012-01-30 - 151ecc2 / 8b93312 - lavu 51.36.100 / 51.22.0 - intfloat.h
Add a new installed header libavutil/intfloat.h with int/float punning
functions.
NOTE: this was backported to 0.8
2012-01-25 - lavf 53.22.0
f1caf01 Allow doing av_write_frame(ctx, NULL) for flushing possible
2012-01-25 - lavf 53.31.100 / 53.22.0
3c5fe5b / f1caf01 Allow doing av_write_frame(ctx, NULL) for flushing possible
buffered data within a muxer. Added AVFMT_ALLOW_FLUSH for
muxers supporting it (av_write_frame makes sure it is called
only for muxers with this flag).
2012-01-15 - lavc 53.34.0
2012-01-15 - lavc 53.56.105 / 53.34.0
New audio encoding API:
b2c75b6 Add CODEC_CAP_VARIABLE_FRAME_SIZE capability for use by audio
67f5650 / b2c75b6 Add CODEC_CAP_VARIABLE_FRAME_SIZE capability for use by audio
encoders.
5ee5fa0 Add avcodec_fill_audio_frame() as a convenience function.
b2c75b6 Add avcodec_encode_audio2() and deprecate avcodec_encode_audio().
67f5650 / 5ee5fa0 Add avcodec_fill_audio_frame() as a convenience function.
67f5650 / b2c75b6 Add avcodec_encode_audio2() and deprecate avcodec_encode_audio().
Add AVCodec.encode2().
2012-01-12 - 3167dc9 - lavfi 2.15.0
2012-01-12 - b18e17e / 3167dc9 - lavfi 2.59.100 / 2.15.0
Add a new installed header -- libavfilter/version.h -- with version macros.
2011-12-08 - a502939 - lavfi 2.52.0
@ -400,37 +400,37 @@ API changes, most recent first:
2011-10-20 - b35e9e1 - lavu 51.22.0
Add av_strtok() to avstring.h.
2011-01-03 - b73ec05 - lavu 51.21.0
2012-01-03 - ad1c8dd / b73ec05 - lavu 51.34.100 / 51.21.0
Add av_popcount64
2011-12-18 - 8400b12 - lavc 53.28.1
2011-12-18 - 7c29313 / 8400b12 - lavc 53.46.1 / 53.28.1
Deprecate AVFrame.age. The field is unused.
2011-12-12 - 5266045 - lavf 53.17.0
2011-12-12 - 8bc7fe4 / 5266045 - lavf 53.25.0 / 53.17.0
Add avformat_close_input().
Deprecate av_close_input_file() and av_close_input_stream().
2011-12-02 - 0eea212 - lavc 53.25.0
2011-12-02 - e4de716 / 0eea212 - lavc 53.40.0 / 53.25.0
Add nb_samples and extended_data fields to AVFrame.
Deprecate AVCODEC_MAX_AUDIO_FRAME_SIZE.
Deprecate avcodec_decode_audio3() in favor of avcodec_decode_audio4().
avcodec_decode_audio4() writes output samples to an AVFrame, which allows
audio decoders to use get_buffer().
2011-12-04 - 560f773 - lavc 53.24.0
2011-12-04 - e4de716 / 560f773 - lavc 53.40.0 / 53.24.0
Change AVFrame.data[4]/base[4]/linesize[4]/error[4] to [8] at next major bump.
Change AVPicture.data[4]/linesize[4] to [8] at next major bump.
Change AVCodecContext.error[4] to [8] at next major bump.
Add AV_NUM_DATA_POINTERS to simplify the bump transition.
2011-11-23 - bbb46f3 - lavu 51.18.0
2011-11-23 - 8e576d5 / bbb46f3 - lavu 51.27.0 / 51.18.0
Add av_samples_get_buffer_size(), av_samples_fill_arrays(), and
av_samples_alloc(), to samplefmt.h.
2011-11-23 - 8889cc4 - lavu 51.17.0
2011-11-23 - 8e576d5 / 8889cc4 - lavu 51.27.0 / 51.17.0
Add planar sample formats and av_sample_fmt_is_planar() to samplefmt.h.
2011-11-19 - f3a29b7 - lavc 53.21.0
2011-11-19 - dbb38bc / f3a29b7 - lavc 53.36.0 / 53.21.0
Move some AVCodecContext fields to a new private struct, AVCodecInternal,
which is accessed from a new field, AVCodecContext.internal.
- fields moved:
@ -438,55 +438,55 @@ API changes, most recent first:
AVCodecContext.internal_buffer_count --> AVCodecInternal.buffer_count
AVCodecContext.is_copy --> AVCodecInternal.is_copy
2011-11-16 - 6270671 - lavu 51.16.0
2011-11-16 - 8709ba9 / 6270671 - lavu 51.26.0 / 51.16.0
Add av_timegm()
2011-11-13 - lavf 53.15.0
2011-11-13 - lavf 53.21.0 / 53.15.0
New interrupt callback API, allowing per-AVFormatContext/AVIOContext
interrupt callbacks.
6aa0b98 Add AVIOInterruptCB struct and the interrupt_callback field to
5f268ca / 6aa0b98 Add AVIOInterruptCB struct and the interrupt_callback field to
AVFormatContext.
1dee0ac Add avio_open2() with additional parameters. Those are
5f268ca / 1dee0ac Add avio_open2() with additional parameters. Those are
an interrupt callback and an options AVDictionary.
This will allow passing AVOptions to protocols after lavf
54.0.
2011-11-06 - ba04ecf - lavu 51.14.0
2011-11-06 - 13b7781 / ba04ecf - lavu 51.24.0 / 51.14.0
Add av_strcasecmp() and av_strncasecmp() to avstring.h.
2011-11-06 - 07b172f - lavu 51.13.0
2011-11-06 - 13b7781 / 07b172f - lavu 51.24.0 / 51.13.0
Add av_toupper()/av_tolower()
2011-11-05 - b6d08f4 - lavf 53.13.0
2011-11-05 - d8cab5c / b6d08f4 - lavf 53.19.0 / 53.13.0
Add avformat_network_init()/avformat_network_deinit()
2011-10-27 - 512557b - lavc 53.15.0
2011-10-27 - 6faf0a2 / 512557b - lavc 53.24.0 / 53.15.0
Remove avcodec_parse_frame.
Deprecate AVCodecContext.parse_only and CODEC_CAP_PARSE_ONLY.
2011-10-19 - 569129a - lavf 53.10.0
2011-10-19 - d049257 / 569129a - lavf 53.17.0 / 53.10.0
Add avformat_new_stream(). Deprecate av_new_stream().
2011-10-13 - b631fba - lavf 53.9.0
2011-10-13 - 91eb1b1 / b631fba - lavf 53.16.0 / 53.9.0
Add AVFMT_NO_BYTE_SEEK AVInputFormat flag.
2011-10-12 - lavu 51.12.0
2011-10-12 - lavu 51.21.0 / 51.12.0
AVOptions API rewrite.
- 145f741 FF_OPT_TYPE* renamed to AV_OPT_TYPE_*
- f884ef0 / 145f741 FF_OPT_TYPE* renamed to AV_OPT_TYPE_*
- new setting/getting functions with slightly different semantics:
dac66da av_set_string3 -> av_opt_set
f884ef0 / dac66da av_set_string3 -> av_opt_set
av_set_double -> av_opt_set_double
av_set_q -> av_opt_set_q
av_set_int -> av_opt_set_int
41d9d51 av_get_string -> av_opt_get
f884ef0 / 41d9d51 av_get_string -> av_opt_get
av_get_double -> av_opt_get_double
av_get_q -> av_opt_get_q
av_get_int -> av_opt_get_int
- 8c5dcaa trivial rename av_next_option -> av_opt_next
- 641c7af new functions - av_opt_child_next, av_opt_child_class_next
- f884ef0 / 8c5dcaa trivial rename av_next_option -> av_opt_next
- f884ef0 / 641c7af new functions - av_opt_child_next, av_opt_child_class_next
and av_opt_find2()
2011-09-22 - a70e787 - lavu 51.17.0
@ -532,31 +532,31 @@ API changes, most recent first:
2011-08-20 - 69e2c1a - lavu 51.13.0
Add av_get_media_type_string().
2011-09-03 - fb4ca26 - lavc 53.13.0
2011-09-03 - 1889c67 / fb4ca26 - lavc 53.13.0
lavf 53.11.0
lsws 2.1.0
Add {avcodec,avformat,sws}_get_class().
2011-08-03 - c11fb82 - lavu 51.15.0
2011-08-03 - 1889c67 / c11fb82 - lavu 51.15.0
Add AV_OPT_SEARCH_FAKE_OBJ flag for av_opt_find() function.
2011-08-14 - 323b930 - lavu 51.12.0
Add av_fifo_peek2(), deprecate av_fifo_peek().
2011-08-26 - lavu 51.9.0
- add41de..abc78a5 Do not include intfloat_readwrite.h,
2011-08-26 - lavu 51.14.0 / 51.9.0
- 976a8b2 / add41de..976a8b2 / abc78a5 Do not include intfloat_readwrite.h,
mathematics.h, rational.h, pixfmt.h, or log.h from avutil.h.
2011-08-16 - 48f9e45 - lavf 53.8.0
2011-08-16 - 27fbe31 / 48f9e45 - lavf 53.11.0 / 53.8.0
Add avformat_query_codec().
2011-08-16 - bca06e7 - lavc 53.11.0
2011-08-16 - 27fbe31 / bca06e7 - lavc 53.11.0
Add avcodec_get_type().
2011-08-06 - 2f63440 - lavf 53.7.0
2011-08-06 - 0cb233c / 2f63440 - lavf 53.7.0
Add error_recognition to AVFormatContext.
2011-08-02 - 9d39cbf - lavc 53.9.1
2011-08-02 - 1d186e9 / 9d39cbf - lavc 53.9.1
Add AV_PKT_FLAG_CORRUPT AVPacket flag.
2011-07-16 - b57df29 - lavfi 2.27.0
@ -567,11 +567,11 @@ API changes, most recent first:
avfilter_set_common_packing_formats()
avfilter_all_packing_formats()
2011-07-10 - a67c061 - lavf 53.6.0
2011-07-10 - 3602ad7 / a67c061 - lavf 53.6.0
Add avformat_find_stream_info(), deprecate av_find_stream_info().
NOTE: this was backported to 0.7
2011-07-10 - 0b950fe - lavc 53.8.0
2011-07-10 - 3602ad7 / 0b950fe - lavc 53.8.0
Add avcodec_open2(), deprecate avcodec_open().
NOTE: this was backported to 0.7
@ -614,35 +614,35 @@ API changes, most recent first:
2011-06-12 - 6119b23 - lavfi 2.16.0 - avfilter_graph_parse()
Change avfilter_graph_parse() signature.
2011-06-23 - 67e9ae1 - lavu 51.8.0 - attributes.h
2011-06-23 - 686959e / 67e9ae1 - lavu 51.10.0 / 51.8.0 - attributes.h
Add av_printf_format().
2011-06-16 - 05e84c9, 25de595 - lavf 53.2.0 - avformat.h
2011-06-16 - 2905e3f / 05e84c9, 2905e3f / 25de595 - lavf 53.4.0 / 53.2.0 - avformat.h
Add avformat_open_input and avformat_write_header().
Deprecate av_open_input_stream, av_open_input_file,
AVFormatParameters and av_write_header.
2011-06-16 - 7e83e1c, dc59ec5 - lavu 51.7.0 - opt.h
2011-06-16 - 2905e3f / 7e83e1c, 2905e3f / dc59ec5 - lavu 51.9.0 / 51.7.0 - opt.h
Add av_opt_set_dict() and av_opt_find().
Deprecate av_find_opt().
Add AV_DICT_APPEND flag.
2011-06-10 - cb7c11c - lavu 51.6.0 - opt.h
2011-06-10 - 45fb647 / cb7c11c - lavu 51.6.0 - opt.h
Add av_opt_flag_is_set().
2011-06-10 - c381960 - lavfi 2.15.0 - avfilter_get_audio_buffer_ref_from_arrays
Add avfilter_get_audio_buffer_ref_from_arrays() to avfilter.h.
2011-06-09 - d9f80ea - lavu 51.8.0 - AVMetadata
2011-06-09 - f9ecb84 / d9f80ea - lavu 51.8.0 - AVMetadata
Move AVMetadata from lavf to lavu and rename it to
AVDictionary -- new installed header dict.h.
All av_metadata_* functions renamed to av_dict_*.
2011-06-07 - a6703fa - lavu 51.8.0 - av_get_bytes_per_sample()
2011-06-07 - d552f61 / a6703fa - lavu 51.8.0 - av_get_bytes_per_sample()
Add av_get_bytes_per_sample() in libavutil/samplefmt.h.
Deprecate av_get_bits_per_sample_fmt().
2011-06-05 - b39b062 - lavu 51.8.0 - opt.h
2011-06-05 - f956924 / b39b062 - lavu 51.8.0 - opt.h
Add av_opt_free convenience function.
2011-06-06 - 95a0242 - lavfi 2.14.0 - AVFilterBufferRefAudioProps
@ -672,7 +672,7 @@ API changes, most recent first:
Add av_get_pix_fmt_name() in libavutil/pixdesc.h, and deprecate
avcodec_get_pix_fmt_name() in libavcodec/avcodec.h in its favor.
2011-05-25 - 30315a8 - lavf 53.3.0 - avformat.h
2011-05-25 - 39e4206 / 30315a8 - lavf 53.3.0 - avformat.h
Add fps_probe_size to AVFormatContext.
2011-05-22 - 5ecdfd0 - lavf 53.2.0 - avformat.h
@ -688,10 +688,10 @@ API changes, most recent first:
2011-05-14 - 9fdf772 - lavfi 2.6.0 - avcodec.h
Add avfilter_get_video_buffer_ref_from_frame() to libavfilter/avcodec.h.
2011-05-18 - 64150ff - lavc 53.7.0 - AVCodecContext.request_sample_fmt
2011-05-18 - 75a37b5 / 64150ff - lavc 53.7.0 - AVCodecContext.request_sample_fmt
Add request_sample_fmt field to AVCodecContext.
2011-05-10 - 188dea1 - lavc 53.6.0 - avcodec.h
2011-05-10 - 59eb12f / 188dea1 - lavc 53.6.0 - avcodec.h
Deprecate AVLPCType and the following fields in
AVCodecContext: lpc_coeff_precision, prediction_order_method,
min_partition_order, max_partition_order, lpc_type, lpc_passes.
@ -721,81 +721,81 @@ API changes, most recent first:
Add av_dynarray_add function for adding
an element to a dynamic array.
2011-04-26 - bebe72f - lavu 51.1.0 - avutil.h
2011-04-26 - d7e5aeb / bebe72f - lavu 51.1.0 - avutil.h
Add AVPictureType enum and av_get_picture_type_char(), deprecate
FF_*_TYPE defines and av_get_pict_type_char() defined in
libavcodec/avcodec.h.
2011-04-26 - 10d3940 - lavfi 2.3.0 - avfilter.h
2011-04-26 - d7e5aeb / 10d3940 - lavfi 2.3.0 - avfilter.h
Add pict_type and key_frame fields to AVFilterBufferRefVideo.
2011-04-26 - 7a11c82 - lavfi 2.2.0 - vsrc_buffer
2011-04-26 - d7e5aeb / 7a11c82 - lavfi 2.2.0 - vsrc_buffer
Add sample_aspect_ratio fields to vsrc_buffer arguments
2011-04-21 - 94f7451 - lavc 53.1.0 - avcodec.h
2011-04-21 - 8772156 / 94f7451 - lavc 53.1.0 - avcodec.h
Add CODEC_CAP_SLICE_THREADS for codecs supporting sliced threading.
2011-04-15 - lavc 52.120.0 - avcodec.h
AVPacket structure got additional members for passing side information:
4de339e introduce side information for AVPacket
2d8591c make containers pass palette change in AVPacket
c407984 / 4de339e introduce side information for AVPacket
c407984 / 2d8591c make containers pass palette change in AVPacket
2011-04-12 - lavf 52.107.0 - avio.h
Avio cleanup, part II - deprecate the entire URLContext API:
175389c add avio_check as a replacement for url_exist
ff1ec0c add avio_pause and avio_seek_time as replacements
c55780d / 175389c add avio_check as a replacement for url_exist
9891004 / ff1ec0c add avio_pause and avio_seek_time as replacements
for _av_url_read_fseek/fpause
cdc6a87 deprecate av_protocol_next(), avio_enum_protocols
d4d0932 / cdc6a87 deprecate av_protocol_next(), avio_enum_protocols
should be used instead.
80c6e23 rename url_set_interrupt_cb->avio_set_interrupt_cb.
f87b1b3 rename open flags: URL_* -> AVIO_*
f8270bb add avio_enum_protocols.
5593f03 deprecate URLProtocol.
c486dad deprecate URLContext.
026e175 deprecate the typedef for URLInterruptCB
8e76a19 deprecate av_register_protocol2.
b840484 deprecate URL_PROTOCOL_FLAG_NESTED_SCHEME
1305d93 deprecate av_url_read_seek
fa104e1 deprecate av_url_read_pause
727c7aa deprecate url_get_filename().
5958df3 deprecate url_max_packet_size().
1869ea0 deprecate url_get_file_handle().
32a97d4 deprecate url_filesize().
e52a914 deprecate url_close().
58a48c6 deprecate url_seek().
925e908 deprecate url_write().
dce3756 deprecate url_read_complete().
bc371ac deprecate url_read().
0589da0 deprecate url_open().
62eaaea deprecate url_connect.
5652bb9 deprecate url_alloc.
333e894 deprecate url_open_protocol
e230705 deprecate url_poll and URLPollEntry
c88caa5 / 80c6e23 rename url_set_interrupt_cb->avio_set_interrupt_cb.
c88caa5 / f87b1b3 rename open flags: URL_* -> AVIO_*
d4d0932 / f8270bb add avio_enum_protocols.
d4d0932 / 5593f03 deprecate URLProtocol.
d4d0932 / c486dad deprecate URLContext.
d4d0932 / 026e175 deprecate the typedef for URLInterruptCB
c88caa5 / 8e76a19 deprecate av_register_protocol2.
11d7841 / b840484 deprecate URL_PROTOCOL_FLAG_NESTED_SCHEME
11d7841 / 1305d93 deprecate av_url_read_seek
11d7841 / fa104e1 deprecate av_url_read_pause
434f248 / 727c7aa deprecate url_get_filename().
434f248 / 5958df3 deprecate url_max_packet_size().
434f248 / 1869ea0 deprecate url_get_file_handle().
434f248 / 32a97d4 deprecate url_filesize().
434f248 / e52a914 deprecate url_close().
434f248 / 58a48c6 deprecate url_seek().
434f248 / 925e908 deprecate url_write().
434f248 / dce3756 deprecate url_read_complete().
434f248 / bc371ac deprecate url_read().
434f248 / 0589da0 deprecate url_open().
434f248 / 62eaaea deprecate url_connect.
434f248 / 5652bb9 deprecate url_alloc.
434f248 / 333e894 deprecate url_open_protocol
434f248 / e230705 deprecate url_poll and URLPollEntry
2011-04-08 - lavf 52.106.0 - avformat.h
Minor avformat.h cleanup:
a9bf9d8 deprecate av_guess_image2_codec
c3675df rename avf_sdp_create->av_sdp_create
d4d0932 / a9bf9d8 deprecate av_guess_image2_codec
d4d0932 / c3675df rename avf_sdp_create->av_sdp_create
2011-04-03 - lavf 52.105.0 - avio.h
Large-scale renaming/deprecating of AVIOContext-related functions:
724f6a0 deprecate url_fdopen
403ee83 deprecate url_open_dyn_packet_buf
6dc7d80 rename url_close_dyn_buf -> avio_close_dyn_buf
b92c545 rename url_open_dyn_buf -> avio_open_dyn_buf
8978fed introduce an AVIOContext.seekable field as a replacement for
2cae980 / 724f6a0 deprecate url_fdopen
2cae980 / 403ee83 deprecate url_open_dyn_packet_buf
2cae980 / 6dc7d80 rename url_close_dyn_buf -> avio_close_dyn_buf
2cae980 / b92c545 rename url_open_dyn_buf -> avio_open_dyn_buf
2cae980 / 8978fed introduce an AVIOContext.seekable field as a replacement for
AVIOContext.is_streamed and url_is_streamed()
b64030f deprecate get_checksum()
4c4427a deprecate init_checksum()
4ec153b deprecate udp_set_remote_url/get_local_port
933e90a deprecate av_url_read_fseek/fpause
8d9769a deprecate url_fileno
b7f2fdd rename put_flush_packet -> avio_flush
35f1023 deprecate url_close_buf
83fddae deprecate url_open_buf
d9d86e0 rename url_fprintf -> avio_printf
59f65d9 deprecate url_setbufsize
3e68b3b deprecate url_ferror
1caa412 / b64030f deprecate get_checksum()
1caa412 / 4c4427a deprecate init_checksum()
2fd41c9 / 4ec153b deprecate udp_set_remote_url/get_local_port
4fa0e24 / 933e90a deprecate av_url_read_fseek/fpause
4fa0e24 / 8d9769a deprecate url_fileno
0fecf26 / b7f2fdd rename put_flush_packet -> avio_flush
0fecf26 / 35f1023 deprecate url_close_buf
0fecf26 / 83fddae deprecate url_open_buf
0fecf26 / d9d86e0 rename url_fprintf -> avio_printf
0fecf26 / 59f65d9 deprecate url_setbufsize
6947b0c / 3e68b3b deprecate url_ferror
e8bb2e2 deprecate url_fget_max_packet_size
76aa876 rename url_fsize -> avio_size
e519753 deprecate url_fgetc
@ -816,7 +816,7 @@ API changes, most recent first:
b3db9ce deprecate get_partial_buffer
8d9ac96 rename av_alloc_put_byte -> avio_alloc_context
2011-03-25 - 34b47d7 - lavc 52.115.0 - AVCodecContext.audio_service_type
2011-03-25 - 27ef7b1 / 34b47d7 - lavc 52.115.0 - AVCodecContext.audio_service_type
Add audio_service_type field to AVCodecContext.
2011-03-17 - e309fdc - lavu 50.40.0 - pixfmt.h
@ -854,11 +854,11 @@ API changes, most recent first:
2011-02-10 - 12c14cd - lavf 52.99.0 - AVStream.disposition
Add AV_DISPOSITION_HEARING_IMPAIRED and AV_DISPOSITION_VISUAL_IMPAIRED.
2011-02-09 - 5592734 - lavc 52.112.0 - avcodec_thread_init()
2011-02-09 - c0b102c - lavc 52.112.0 - avcodec_thread_init()
Deprecate avcodec_thread_init()/avcodec_thread_free() use; instead
set thread_count before calling avcodec_open.
2011-02-09 - 778b08a - lavc 52.111.0 - threading API
2011-02-09 - 37b00b4 - lavc 52.111.0 - threading API
Add CODEC_CAP_FRAME_THREADS with new restrictions on get_buffer()/
release_buffer()/draw_horiz_band() callbacks for appropriate codecs.
Add thread_type and active_thread_type fields to AVCodecContext.

View File

@ -31,7 +31,7 @@ PROJECT_NAME = FFmpeg
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER =
PROJECT_NUMBER = 1.1.16
# With the PROJECT_LOGO tag one can specify an logo or icon that is included
# in the documentation. The maximum height of the logo should not exceed 55

View File

@ -92,9 +92,9 @@ uninstall: uninstall-man
uninstall-man:
$(RM) $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
docclean: clean
clean:: docclean
clean::
docclean:
$(RM) $(TXTPAGES) doc/*.html doc/*.pod doc/*.1 doc/*.3 $(CLEANSUFFIXES:%=doc/%) doc/avoptions_*.texi
$(RM) -r doc/doxy/html

View File

@ -1,7 +1,7 @@
Release Notes
=============
* 0.10 "Freedom" January, 2012
* 1.1 "Fire Flower" January, 2013
General notes
@ -20,3 +20,6 @@ compiler. Since MSVC does not support C99 features used extensively by FFmpeg,
this has been accomplished using a converter that turns C99 code to C89. See the
platform-specific documentation for more detailed documentation on building
FFmpeg with MSVC.
The used output sample format for several audio decoders has changed, make
sure you always check/use AVCodecContext.sample_fmt or AVFrame.format.

View File

@ -60,6 +60,78 @@ This decoder generates wave patterns according to predefined sequences. Its
use is purely internal and the format of the data it accepts is not publicly
documented.
@section libcelt
libcelt decoder wrapper
libcelt allows libavcodec to decode the Xiph CELT ultra-low delay audio codec.
Requires the presence of the libcelt headers and library during configuration.
You need to explicitly configure the build with @code{--enable-libcelt}.
@section libgsm
libgsm decoder wrapper
libgsm allows libavcodec to decode the GSM full rate audio codec. Requires
the presence of the libgsm headers and library during configuration. You need
to explicitly configure the build with @code{--enable-libgsm}.
This decoder supports both the ordinary GSM and the Microsoft variant.
@section libilbc
libilbc decoder wrapper
libilbc allows libavcodec to decode the Internet Low Bitrate Codec (iLBC)
audio codec. Requires the presence of the libilbc headers and library during
configuration. You need to explicitly configure the build with
@code{--enable-libilbc}.
@subsection Options
The following option is supported by the libilbc wrapper.
@table @option
@item enhance
Enable the enhancement of the decoded audio when set to 1. The default
value is 0 (disabled).
@end table
@section libopencore-amrnb
libopencore-amrnb decoder wrapper
libopencore-amrnb allows libavcodec to decode the Adaptive Multi-Rate
Narrowband audio codec. Using it requires the presence of the
libopencore-amrnb headers and library during configuration. You need to
explicitly configure the build with @code{--enable-libopencore-amrnb}.
An FFmpeg native decoder for AMR-NB exists, so users can decode AMR-NB
without this library.
@section libopencore-amrwb
libopencore-amrwb decoder wrapper.
libopencore-amrwb allows libavcodec to decode the Adaptive Multi-Rate
Wideband audio codec. Using it requires the presence of the
libopencore-amrwb headers and library during configuration. You need to
explicitly configure the build with @code{--enable-libopencore-amrwb}.
An FFmpeg native decoder for AMR-WB exists, so users can decode AMR-WB
without this library.
@section libopus
libopus decoder wrapper.
libopus allows libavcodec to decode the Opus Interactive Audio Codec.
Requires the presence of the libopus headers and library during
configuration. You need to explicitly configure the build with
@code{--enable-libopus}.
@c man end AUDIO DECODERS
@chapter Subtitles Decoders

View File

@ -190,8 +190,8 @@ set shiftwidth=4
set softtabstop=4
set cindent
set cinoptions=(0
" allow tabs in Makefiles
autocmd FileType make set noexpandtab shiftwidth=8 softtabstop=8
" Allow tabs in Makefiles.
autocmd FileType make,automake set noexpandtab shiftwidth=8 softtabstop=8
" Trailing whitespace and tabs are forbidden, so highlight them.
highlight ForbiddenWhitespace ctermbg=red guibg=red
match ForbiddenWhitespace /\s\+$\|\t/

View File

@ -25,6 +25,95 @@ enabled encoders.
A description of some of the currently available audio encoders
follows.
@anchor{aacenc}
@section aac
Advanced Audio Coding (AAC) encoder.
This encoder is an experimental FFmpeg-native AAC encoder. Currently only the
low complexity (AAC-LC) profile is supported. To use this encoder, you must set
@option{strict} option to @samp{experimental} or lower.
As this encoder is experimental, unexpected behavior may exist from time to
time. For a more stable AAC encoder, see @ref{libvo-aacenc}. However, be warned
that it has a worse quality reported by some users.
@c Comment this out until somebody writes the respective documentation.
@c See also @ref{libfaac}, @ref{libaacplus}, and @ref{libfdk-aac-enc}.
@subsection Options
@table @option
@item b
Set bit rate in bits/s. Setting this automatically activates constant bit rate
(CBR) mode.
@item q
Set quality for variable bit rate (VBR) mode. This option is valid only using
the @command{ffmpeg} command-line tool. For library interface users, use
@option{global_quality}.
@item stereo_mode
Set stereo encoding mode. Possible values:
@table @samp
@item auto
Automatically selected by the encoder.
@item ms_off
Disable middle/side encoding. This is the default.
@item ms_force
Force middle/side encoding.
@end table
@item aac_coder
Set AAC encoder coding method. Possible values:
@table @samp
@item 0
FAAC-inspired method.
This method is a simplified reimplementation of the method used in FAAC, which
sets thresholds proportional to the band energies, and then decreases all the
thresholds with quantizer steps to find the appropriate quantization with
distortion below threshold band by band.
The quality of this method is comparable to the two loop searching method
descibed below, but somewhat a little better and slower.
@item 1
Average noise to mask ratio (ANMR) trellis-based solution.
This has a theoretic best quality out of all the coding methods, but at the
cost of the slowest speed.
@item 2
Two loop searching (TLS) method.
This method first sets quantizers depending on band thresholds and then tries
to find an optimal combination by adding or subtracting a specific value from
all quantizers and adjusting some individual quantizer a little.
This method produces similar quality with the FAAC method and is the default.
@item 3
Constant quantizer method.
This method sets a constant quantizer for all bands. This is the fastest of all
the methods, yet produces the worst quality.
@end table
@end table
@subsection Tips and Tricks
According to some reports
(e.g. @url{http://d.hatena.ne.jp/kamedo2/20120729/1343545890}), setting the
@option{cutoff} option to 15000 Hz greatly improves the quality of the output
quality. As a result, we encourage you to do the same.
@section ac3 and ac3_fixed
AC-3 audio encoders.
@ -412,6 +501,279 @@ Selected by Encoder (default)
@end table
@section libmp3lame
LAME (Lame Ain't an MP3 Encoder) MP3 encoder wrapper
Requires the presence of the libmp3lame headers and library during
configuration. You need to explicitly configure the build with
@code{--enable-libmp3lame}.
@subsection Options
The following options are supported by the libmp3lame wrapper. The
@command{lame}-equivalent of the options are listed in parentheses.
@table @option
@item b (@emph{-b})
Set bitrate expressed in bits/s for CBR. LAME @code{bitrate} is
expressed in kilobits/s.
@item q (@emph{-V})
Set constant quality setting for VBR. This option is valid only
using the @command{ffmpeg} command-line tool. For library interface
users, use @option{global_quality}.
@item compression_level (@emph{-q})
Set algorithm quality. Valid arguments are integers in the 0-9 range,
with 0 meaning highest quality but slowest, and 9 meaning fastest
while producing the worst quality.
@item reservoir
Enable use of bit reservoir when set to 1. Default value is 1. LAME
has this enabled by default, but can be overriden by use
@option{--nores} option.
@end table
@section libopencore-amrnb
OpenCORE Adaptive Multi-Rate Narrowband encoder.
Requires the presence of the libopencore-amrnb headers and library during
configuration. You need to explicitly configure the build with
@code{--enable-libopencore-amrnb --enable-version3}.
This is a mono-only encoder. Officially it only supports 8000Hz sample rate,
but you can override it by setting @option{strict} to @samp{unofficial} or
lower.
@subsection Options
@table @option
@item b
Set bitrate in bits per second. Only the following bitrates are supported,
otherwise libavcodec will round to the nearest valid bitrate.
@table @option
@item 4750
@item 5150
@item 5900
@item 6700
@item 7400
@item 7950
@item 10200
@item 12200
@end table
@item dtx
Allow discontinuous transmission (generate comfort noise) when set to 1. The
default value is 0 (disabled).
@end table
@section libtwolame
TwoLAME MP2 encoder wrapper
Requires the presence of the libtwolame headers and library during
configuration. You need to explicitly configure the build with
@code{--enable-libtwolame}.
@subsection Options
The following options are supported by the libtwolame wrapper. The
@command{twolame}-equivalent options follow the FFmpeg ones and are in
parentheses.
@table @option
@item b (@emph{-b})
Set bitrate expressed in bits/s for CBR. @command{twolame} @option{b}
option is expressed in kilobits/s. Default value is 128k.
@item q (@emph{-V})
Set quality for experimental VBR support. Maximum value range is
from -50 to 50, useful range is from -10 to 10. The higher the
value, the better the quality. This option is valid only using the
@command{ffmpeg} command-line tool. For library interface users,
use @option{global_quality}.
@item mode (@emph{--mode})
Set the mode of the resulting audio. Possible values:
@table @samp
@item auto
Choose mode automatically based on the input. This is the default.
@item stereo
Stereo
@item joint_stereo
Joint stereo
@item dual_channel
Dual channel
@item mono
Mono
@end table
@item psymodel (@emph{--psyc-mode})
Set psychoacoustic model to use in encoding. The argument must be
an integer between -1 and 4, inclusive. The higher the value, the
better the quality. The default value is 3.
@item energy_levels (@emph{--energy})
Enable energy levels extensions when set to 1. The default value is
0 (disabled).
@item error_protection (@emph{--protect})
Enable CRC error protection when set to 1. The default value is 0
(disabled).
@item copyright (@emph{--copyright})
Set MPEG audio copyright flag when set to 1. The default value is 0
(disabled).
@item original (@emph{--original})
Set MPEG audio original flag when set to 1. The default value is 0
(disabled).
@end table
@anchor{libvo-aacenc}
@section libvo-aacenc
VisualOn AAC encoder
Requires the presence of the libvo-aacenc headers and library during
configuration. You need to explicitly configure the build with
@code{--enable-libvo-aacenc --enable-version3}.
This encoder is considered to be worse than the
@ref{aacenc,,native experimental FFmpeg AAC encoder}, according to
multiple sources.
@subsection Options
The VisualOn AAC encoder only support encoding AAC-LC and up to 2
channels. It is also CBR-only.
@table @option
@item b
Set bit rate in bits/s.
@end table
@section libvo-amrwbenc
VisualOn Adaptive Multi-Rate Wideband encoder
Requires the presence of the libvo-amrwbenc headers and library during
configuration. You need to explicitly configure the build with
@code{--enable-libvo-amrwbenc --enable-version3}.
This is a mono-only encoder. Officially it only supports 16000Hz sample
rate, but you can override it by setting @option{strict} to
@samp{unofficial} or lower.
@subsection Options
@table @option
@item b
Set bitrate in bits/s. Only the following bitrates are supported, otherwise
libavcodec will round to the nearest valid bitrate.
@table @samp
@item 6600
@item 8850
@item 12650
@item 14250
@item 15850
@item 18250
@item 19850
@item 23050
@item 23850
@end table
@item dtx
Allow discontinuous transmission (generate comfort noise) when set to 1. The
default value is 0 (disabled).
@end table
@section libopus
libopus Opus Interactive Audio Codec encoder wrapper.
Requires the presence of the libopus headers and library during
configuration. You need to explicitly configure the build with
@code{--enable-libopus}.
@subsection Option Mapping
Most libopus options are modeled after the @command{opusenc} utility from
opus-tools. The following is an option mapping chart describing options
supported by the libopus wrapper, and their @command{opusenc}-equivalent
in parentheses.
@table @option
@item b (@emph{bitrate})
Set the bit rate in bits/s. FFmpeg's @option{b} option is
expressed in bits/s, while @command{opusenc}'s @option{bitrate} in
kilobits/s.
@item vbr (@emph{vbr}, @emph{hard-cbr}, and @emph{cvbr})
Set VBR mode. The FFmpeg @option{vbr} option has the following
valid arguments, with the their @command{opusenc} equivalent options
in parentheses:
@table @samp
@item off (@emph{hard-cbr})
Use constant bit rate encoding.
@item on (@emph{vbr})
Use variable bit rate encoding (the default).
@item constrained (@emph{cvbr})
Use constrained variable bit rate encoding.
@end table
@item compression_level (@emph{comp})
Set encoding algorithm complexity. Valid options are integers in
the 0-10 range. 0 gives the fastest encodes but lower quality, while 10
gives the highest quality but slowest encoding. The default is 10.
@item frame_duration (@emph{framesize})
Set maximum frame size, or duration of a frame in milliseconds. The
argument must be exactly the following: 2.5, 5, 10, 20, 40, 60. Smaller
frame sizes achieve lower latency but less quality at a given bitrate.
Sizes greater than 20ms are only interesting at fairly low bitrates.
The default is 20ms.
@item packet_loss (@emph{expect-loss})
Set expected packet loss percentage. The default is 0.
@item application (N.A.)
Set intended application type. Valid options are listed below:
@table @samp
@item voip
Favor improved speech intelligibility.
@item audio
Favor faithfulness to the input (the default).
@item lowdelay
Restrict to only the lowest delay modes.
@end table
@item cutoff (N.A.)
Set cutoff bandwidth in Hz. The argument must be exactly one of the
following: 4000, 6000, 8000, 12000, or 20000, corresponding to
narrowband, mediumband, wideband, super wideband, and fullband
respectively. The default is 0 (cutoff disabled).
@end table
@c man end AUDIO ENCODERS
@chapter Video Encoders
@ -633,4 +995,117 @@ ffmpeg -i foo.mpg -vcodec libx264 -x264opts keyint=123:min-keyint=20 -an out.mkv
For more information about libx264 and the supported options see:
@url{http://www.videolan.org/developers/x264.html}
@section libxvid
Xvid MPEG-4 Part 2 encoder wrapper.
This encoder requires the presence of the libxvidcore headers and library
during configuration. You need to explicitly configure the build with
@code{--enable-libxvid --enable-gpl}.
The native @code{mpeg4} encoder supports the MPEG-4 Part 2 format, so
users can encode to this format without this library.
@subsection Options
The following options are supported by the libxvid wrapper. Some of
the following options are listed but are not documented, and
correspond to shared codec options. See @ref{codec-options,,the Codec
Options chapter} for their documentation. The other shared options
which are not listed have no effect for the libxvid encoder.
@table @option
@item b
@item g
@item qmin
@item qmax
@item mpeg_quant
@item threads
@item bf
@item b_qfactor
@item b_qoffset
@item flags
Set specific encoding flags. Possible values:
@table @samp
@item mv4
Use four motion vector by macroblock.
@item aic
Enable high quality AC prediction.
@item gray
Only encode grayscale.
@item gmc
Enable the use of global motion compensation (GMC).
@item qpel
Enable quarter-pixel motion compensation.
@item cgop
Enable closed GOP.
@item global_header
Place global headers in extradata instead of every keyframe.
@end table
@item trellis
@item me_method
Set motion estimation method. Possible values in decreasing order of
speed and increasing order of quality:
@table @samp
@item zero
Use no motion estimation (default).
@item phods
@item x1
@item log
Enable advanced diamond zonal search for 16x16 blocks and half-pixel
refinement for 16x16 blocks. @samp{x1} and @samp{log} are aliases for
@samp{phods}.
@item epzs
Enable all of the things described above, plus advanced diamond zonal
search for 8x8 blocks, half-pixel refinement for 8x8 blocks, and motion
estimation on chroma planes.
@item full
Enable all of the things described above, plus extended 16x16 and 8x8
blocks search.
@end table
@item mbd
Set macroblock decision algorithm. Possible values in the increasing
order of quality:
@table @samp
@item simple
Use macroblock comparing function algorithm (default).
@item bits
Enable rate distortion-based half pixel and quarter pixel refinement for
16x16 blocks.
@item rd
Enable all of the things described above, plus rate distortion-based
half pixel and quarter pixel refinement for 8x8 blocks, and rate
distortion-based search using square pattern.
@end table
@end table
@c man end VIDEO ENCODERS

View File

@ -314,7 +314,7 @@ int main (int argc, char **argv)
if (audio_stream) {
const char *fmt;
if ((ret = get_format_from_sample_fmt(&fmt, audio_dec_ctx->sample_fmt) < 0))
if ((ret = get_format_from_sample_fmt(&fmt, audio_dec_ctx->sample_fmt)) < 0)
goto end;
printf("Play the output audio file with the command:\n"
"ffplay -f %s -ac %d -ar %d %s\n",

View File

@ -200,7 +200,7 @@ int main(int argc, char **argv)
fwrite(dst_data[0], 1, dst_bufsize, dst_file);
} while (t < 10);
if ((ret = get_format_from_sample_fmt(&fmt, dst_sample_fmt) < 0))
if ((ret = get_format_from_sample_fmt(&fmt, dst_sample_fmt)) < 0)
goto end;
fprintf(stderr, "Resampling succeeded. Play the output file with the command:\n"
"ffplay -f %s -channel_layout %"PRId64" -channels %d -ar %d %s\n",

View File

@ -17,6 +17,7 @@ the libavcodec library.
@c man end DESCRIPTION
@anchor{codec-options}
@chapter Codec Options
@c man begin CODEC OPTIONS

View File

@ -140,6 +140,12 @@ Use wallclock as timestamps.
@item avoid_negative_ts @var{integer} (@emph{output})
Shift timestamps to make them positive. 1 enables, 0 disables, default
of -1 enables when required by target format.
@item skip_initial_bytes @var{integer} (@emph{input})
Set number initial bytes to skip. Default is 0.
@item correct_ts_overflow @var{integer} (@emph{input})
Correct single timestamp overflows if set to 1. Default is 1.
@end table
@c man end FORMAT OPTIONS

View File

@ -978,7 +978,7 @@ ffmpeg -filter_complex 'color=red' -t 5 out.mkv
As a special exception, you can use a bitmap subtitle stream as input: it
will be converted into a video with the same size as the largest video in
the file, or 720×576 if no video is present. Note that this is an
the file, or 720x576 if no video is present. Note that this is an
experimental and temporary solution. It will be removed once libavfilter has
proper support for subtitles.
@ -1254,11 +1254,11 @@ ffmpeg -f image2 -pattern_type glob -i 'foo-*.jpeg' -r 12 -s WxH foo.avi
You can put many streams of the same type in the output:
@example
ffmpeg -i test1.avi -i test2.avi -map 0:3 -map 0:2 -map 0:1 -map 0:0 -c copy test12.nut
ffmpeg -i test1.avi -i test2.avi -map 1:1 -map 1:0 -map 0:1 -map 0:0 -c copy -y test12.nut
@end example
The resulting output file @file{test12.avi} will contain first four streams from
the input file in reverse order.
The resulting output file @file{test12.nut} will contain the first four streams
from the input files in reverse order.
@item
To force CBR video output:

View File

@ -3,10 +3,10 @@
Filtering in FFmpeg is enabled through the libavfilter library.
In libavfilter, it is possible for filters to have multiple inputs and
multiple outputs.
To illustrate the sorts of things that are possible, we can
use a complex filter graph. For example, the following one:
In libavfilter, a filter can have multiple inputs and multiple
outputs.
To illustrate the sorts of things that are possible, we consider the
following filtergraph.
@example
input --> split ---------------------> overlay --> output
@ -15,25 +15,32 @@ input --> split ---------------------> overlay --> output
+-----> crop --> vflip -------+
@end example
splits the stream in two streams, sends one stream through the crop filter
and the vflip filter before merging it back with the other stream by
overlaying it on top. You can use the following command to achieve this:
This filtergraph splits the input stream in two streams, sends one
stream through the crop filter and the vflip filter before merging it
back with the other stream by overlaying it on top. You can use the
following command to achieve this:
@example
ffmpeg -i input -vf "[in] split [T1], [T2] overlay=0:H/2 [out]; [T1] crop=iw:ih/2:0:ih/2, vflip [T2]" output
ffmpeg -i INPUT -vf "split [main][tmp]; [tmp] crop=iw:ih/2:0:0, vflip [flip]; [main][flip] overlay=0:H/2" OUTPUT
@end example
The result will be that in output the top half of the video is mirrored
onto the bottom half.
Filters are loaded using the @var{-vf} or @var{-af} option passed to
@command{ffmpeg} or to @command{ffplay}. Filters in the same linear
chain are separated by commas. In our example, @var{split,
overlay} are in one linear chain, and @var{crop, vflip} are in
another. The points where the linear chains join are labeled by names
enclosed in square brackets. In our example, that is @var{[T1]} and
@var{[T2]}. The special labels @var{[in]} and @var{[out]} are the points
where video is input and output.
Filters in the same linear chain are separated by commas, and distinct
linear chains of filters are separated by semicolons. In our example,
@var{crop,vflip} are in one linear chain, @var{split} and
@var{overlay} are separately in another. The points where the linear
chains join are labelled by names enclosed in square brackets. In the
example, the split filter generates two outputs that are associated to
the labels @var{[main]} and @var{[tmp]}.
The stream sent to the second output of @var{split}, labelled as
@var{[tmp]}, is processed through the @var{crop} filter, which crops
away the lower half part of the video, and then vertically flipped. The
@var{overlay} filter takes in input the first unchanged output of the
split filter (which was labelled as @var{[main]}), and overlay on its
lower half the output generated by the @var{crop,vflip} filterchain.
Some filters take in input a list of parameters: they are specified
after the filter name and an equal sign, and are separated from each other
@ -179,7 +186,7 @@ Follows a BNF description for the filtergraph syntax:
@var{LINKLABEL} ::= "[" @var{NAME} "]"
@var{LINKLABELS} ::= @var{LINKLABEL} [@var{LINKLABELS}]
@var{FILTER_ARGUMENTS} ::= sequence of chars (eventually quoted)
@var{FILTER} ::= [@var{LINKNAMES}] @var{NAME} ["=" @var{ARGUMENTS}] [@var{LINKNAMES}]
@var{FILTER} ::= [@var{LINKLABELS}] @var{NAME} ["=" @var{FILTER_ARGUMENTS}] [@var{LINKLABELS}]
@var{FILTERCHAIN} ::= @var{FILTER} [,@var{FILTERCHAIN}]
@var{FILTERGRAPH} ::= [sws_flags=@var{flags};] @var{FILTERCHAIN} [;@var{FILTERGRAPH}]
@end example
@ -4149,7 +4156,7 @@ Alternatively, the options can be specified as a flat string:
@var{layout}[:@var{nb_frames}[:@var{margin}[:@var{padding}]]]
For example, produce 8×8 PNG tiles of all keyframes (@option{-skip_frame
For example, produce 8x8 PNG tiles of all keyframes (@option{-skip_frame
nokey}) in a movie:
@example
ffmpeg -skip_frame nokey -i file.avi -vf 'scale=128:72,tile=8x8' -an -vsync 0 keyframes%03d.png
@ -5543,7 +5550,7 @@ Activate unsafe mode: do not fail if segments have a different format.
The filter has @var{v}+@var{a} outputs: first @var{v} video outputs, then
@var{a} audio outputs.
There are @var{n}×(@var{v}+@var{a}) inputs: first the inputs for the first
There are @var{n}x(@var{v}+@var{a}) inputs: first the inputs for the first
segment, in the same order as the outputs, then the inputs for the second
segment, etc.

View File

@ -24,7 +24,7 @@ instructions. To enable using OpenJPEG in FFmpeg, pass @code{--enable-libopenjp
@file{./configure}.
@section OpenCORE and VisualOn libraries
@section OpenCORE, VisualOn, and Fraunhofer libraries
Spun off Google Android sources, OpenCore, VisualOn and Fraunhofer
libraries provide encoders for a number of audio codecs.
@ -32,9 +32,14 @@ libraries provide encoders for a number of audio codecs.
@float NOTE
OpenCORE and VisualOn libraries are under the Apache License 2.0
(see @url{http://www.apache.org/licenses/LICENSE-2.0} for details), which is
incompatible with the LGPL version 2.1 and GPL version 2. You have to
incompatible to the LGPL version 2.1 and GPL version 2. You have to
upgrade FFmpeg's license to LGPL version 3 (or if you have enabled
GPL components, GPL version 3) to use it.
GPL components, GPL version 3) by passing @code{--enable-version3} to configure in
order to use it.
The Fraunhofer AAC library is licensed under a license incompatible to the GPL
and is not known to be compatible to the LGPL. Therefore, you have to pass
@code{--enable-nonfree} to configure to use it.
@end float
@subsection OpenCORE AMR

View File

@ -24,7 +24,7 @@ a mail for every change to every issue.
The subscription URL for the ffmpeg-trac list is:
http(s)://ffmpeg.org/mailman/listinfo/ffmpeg-trac
The URL of the webinterface of the tracker is:
http(s)://ffmpeg.org/trac/ffmpeg
http(s)://trac.ffmpeg.org
Type:
-----

View File

@ -18,6 +18,23 @@ enabled muxers.
A description of some of the currently available muxers follows.
@anchor{aiff}
@section aiff
Audio Interchange File Format muxer.
It accepts the following options:
@table @option
@item write_id3v2
Enable ID3v2 tags writing when set to 1. Default is 0 (disabled).
@item id3v2_version
Select ID3v2 version to write. Currently only version 3 and 4 (aka.
ID3v2.3 and ID3v2.4) are supported. The default is version 4.
@end table
@anchor{crc}
@section crc
@ -711,10 +728,11 @@ Write an mp3 with an ID3v2.3 header and an ID3v1 footer:
ffmpeg -i INPUT -id3v2_version 3 -write_id3v1 1 out.mp3
@end example
Attach a picture to an mp3:
To attach a picture to an mp3 file select both the audio and the picture stream
with @code{map}:
@example
ffmpeg -i input.mp3 -i cover.png -c copy -metadata:s:v title="Album cover"
-metadata:s:v comment="Cover (Front)" out.mp3
ffmpeg -i input.mp3 -i cover.png -c copy -map 0 -map 1
-metadata:s:v title="Album cover" -metadata:s:v comment="Cover (Front)" out.mp3
@end example
@c man end MUXERS

View File

@ -51,8 +51,9 @@ The toolchain provided with Xcode is sufficient to build the basic
unacelerated code.
Mac OS X on PowerPC or ARM (iPhone) requires a preprocessor from
@url{https://github.com/FFmpeg/gas-preprocessor} or
@url{http://github.com/yuvi/gas-preprocessor} to build the optimized
assembler functions. Just download the Perl script and put it somewhere
assembler functions. Put the Perl script somewhere
in your PATH, FFmpeg's configure will pick it up automatically.
Mac OS X on amd64 and x86 requires @command{yasm} to build most of the
@ -114,7 +115,7 @@ wrapper.
You will need the following prerequisites:
@itemize
@item @uref{https://github.com/libav/c99-to-c89/, C99-to-C89 Converter & Wrapper}
@item @uref{http://download.videolan.org/pub/contrib/c99-to-c89/, C99-to-C89 Converter & Wrapper}
@item @uref{http://code.google.com/p/msinttypes/, msinttypes}
@item @uref{http://www.mingw.org/, MSYS}
@item @uref{http://yasm.tortall.net/, YASM}

View File

@ -121,7 +121,7 @@ INF: while(<$inf>) {
$chapters{$chapter_name} .= postprocess($chapter) if ($chapter_name);
# start new chapter
$chapter_name = $1, push (@chapters_sequence, $chapter_name);
$chapter_name = $1, push (@chapters_sequence, $chapter_name) unless $skipping;
$chapters{$chapter_name} = "" unless exists $chapters{$chapter_name};
$chapter = "";
$output = 1;
@ -169,7 +169,7 @@ INF: while(<$inf>) {
} elsif ($ended =~ /^(?:example|smallexample|display)$/) {
$shift = "";
$_ = ""; # need a paragraph break
} elsif ($ended =~ /^(?:itemize|enumerate|[fv]?table)$/) {
} elsif ($ended =~ /^(?:itemize|enumerate|(?:multi|[fv])?table)$/) {
$_ = "\n=back\n";
$ic = pop @icstack;
} else {
@ -269,7 +269,7 @@ INF: while(<$inf>) {
$endw = "enumerate";
};
/^\@([fv]?table)\s+(\@[a-z]+)/ and do {
/^\@((?:multi|[fv])?table)\s+(\@[a-z]+)/ and do {
push @endwstack, $endw;
push @icstack, $ic;
$endw = $1;
@ -278,6 +278,7 @@ INF: while(<$inf>) {
$ic =~ s/\@(?:code|kbd)/C/;
$ic =~ s/\@(?:dfn|var|emph|cite|i)/I/;
$ic =~ s/\@(?:file)/F/;
$ic =~ s/\@(?:columnfractions)//;
$_ = "\n=over 4\n";
};
@ -288,6 +289,21 @@ INF: while(<$inf>) {
$_ = ""; # need a paragraph break
};
/^\@item\s+(.*\S)\s*$/ and $endw eq "multitable" and do {
my $columns = $1;
$columns =~ s/\@tab/ : /;
$_ = "\n=item B&LT;". $columns ."&GT;\n";
};
/^\@tab\s+(.*\S)\s*$/ and $endw eq "multitable" and do {
my $columns = $1;
$columns =~ s/\@tab/ : /;
$_ = " : ". $columns;
$chapter =~ s/\n+\s+$//;
};
/^\@itemx?\s*(.+)?$/ and do {
if (defined $1) {
# Entity escapes prevent munging by the <> processing below.
@ -361,6 +377,7 @@ sub postprocess
s/\(?\@xref\{(?:[^\}]*)\}(?:[^.<]|(?:<[^<>]*>))*\.\)?//g;
s/\s+\(\@pxref\{(?:[^\}]*)\}\)//g;
s/;\s+\@pxref\{(?:[^\}]*)\}//g;
s/\@ref\{(?:[^,\}]*,)(?:[^,\}]*,)([^,\}]*).*\}/$1/g;
s/\@ref\{([^\}]*)\}/$1/g;
s/\@noindent\s*//g;
s/\@refill//g;

View File

@ -152,6 +152,8 @@ static struct termios oldtty;
static int restore_tty;
#endif
static void free_input_threads(void);
/* sub2video hack:
Convert subtitles to video with alpha to insert them in filter graphs.
@ -441,6 +443,9 @@ static void exit_program(void)
av_freep(&output_streams[i]->logfile_prefix);
av_freep(&output_streams[i]);
}
#if HAVE_PTHREADS
free_input_threads();
#endif
for (i = 0; i < nb_input_files; i++) {
avformat_close_input(&input_files[i]->ctx);
av_freep(&input_files[i]);
@ -471,7 +476,6 @@ static void exit_program(void)
if (received_sigterm) {
av_log(NULL, AV_LOG_INFO, "Received signal %d: terminating.\n",
(int) received_sigterm);
exit (255);
}
}
@ -574,6 +578,25 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost)
bsfc = bsfc->next;
}
if (!(s->oformat->flags & AVFMT_NOTIMESTAMPS) &&
ost->last_mux_dts != AV_NOPTS_VALUE &&
pkt->dts < ost->last_mux_dts + !(s->oformat->flags & AVFMT_TS_NONSTRICT)) {
av_log(NULL, AV_LOG_WARNING, "Non-monotonous DTS in output stream "
"%d:%d; previous: %"PRId64", current: %"PRId64"; ",
ost->file_index, ost->st->index, ost->last_mux_dts, pkt->dts);
if (exit_on_error) {
av_log(NULL, AV_LOG_FATAL, "aborting.\n");
exit(1);
}
av_log(NULL, AV_LOG_WARNING, "changing to %"PRId64". This may result "
"in incorrect timestamps in the output file.\n",
ost->last_mux_dts + 1);
pkt->dts = ost->last_mux_dts + 1;
if (pkt->pts != AV_NOPTS_VALUE)
pkt->pts = FFMAX(pkt->pts, pkt->dts);
}
ost->last_mux_dts = pkt->dts;
pkt->stream_index = ost->index;
if (debug_ts) {
@ -992,6 +1015,19 @@ static void do_video_stats(OutputStream *ost, int frame_size)
}
}
static void finish_output_stream(OutputStream *ost)
{
OutputFile *of = output_files[ost->file_index];
int i;
ost->finished = 1;
if (of->shortest) {
for (i = 0; i < of->ctx->nb_streams; i++)
output_streams[of->ost_index + i]->finished = 1;
}
}
/**
* Get and encode new output from any of the filtergraphs, without causing
* activity.
@ -1655,7 +1691,7 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output)
if (!frame_sample_aspect->num)
*frame_sample_aspect = ist->st->sample_aspect_ratio;
if (ist->dr1 && decoded_frame->type==FF_BUFFER_TYPE_USER && !changed) {
if (ist->dr1 && decoded_frame->type==FF_BUFFER_TYPE_USER && !changed && !do_deinterlace) {
FrameBuffer *buf = decoded_frame->opaque;
AVFilterBufferRef *fb = avfilter_get_video_buffer_ref_from_arrays(
decoded_frame->data, decoded_frame->linesize,
@ -1984,7 +2020,7 @@ static int transcode_init(void)
AVCodecContext *codec;
OutputStream *ost;
InputStream *ist;
char error[1024];
char error[1024] = {0};
int want_sdp = 1;
/* init framerate emulation */
@ -2100,6 +2136,12 @@ static int transcode_init(void)
codec->time_base.num *= icodec->ticks_per_frame;
}
}
if ( codec->codec_tag == AV_RL32("tmcd")
&& icodec->time_base.num < icodec->time_base.den
&& icodec->time_base.num > 0
&& 121LL*icodec->time_base.num > icodec->time_base.den) {
codec->time_base = icodec->time_base;
}
if(ost->frame_rate.num)
codec->time_base = av_inv_q(ost->frame_rate);
@ -2754,7 +2796,7 @@ static int process_input(int file_index)
if (ost->source_index == ifile->ist_index + i &&
(ost->stream_copy || ost->enc->type == AVMEDIA_TYPE_SUBTITLE))
close_output_stream(ost);
finish_output_stream(ost);
}
}
@ -3214,6 +3256,6 @@ int main(int argc, char **argv)
printf("bench: utime=%0.3fs maxrss=%ikB\n", ti / 1000000.0, maxrss);
}
exit(0);
exit(received_nb_signals ? 255 : 0);
return 0;
}

View File

@ -300,6 +300,8 @@ typedef struct OutputStream {
/* pts of the first frame encoded for this stream, used for limiting
* recording time */
int64_t first_pts;
/* dts of the last packet sent to the muxer */
int64_t last_mux_dts;
AVBitStreamFilterContext *bitstream_filters;
AVCodec *enc;
int64_t max_frames;

View File

@ -41,12 +41,15 @@ enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodec *codec, enum AVPixelFo
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(target);
int has_alpha = desc ? desc->nb_components % 2 == 0 : 0;
enum AVPixelFormat best= AV_PIX_FMT_NONE;
const enum AVPixelFormat mjpeg_formats[] = { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_NONE };
const enum AVPixelFormat ljpeg_formats[] = { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUV420P,
AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_BGRA, AV_PIX_FMT_NONE };
if (st->codec->strict_std_compliance <= FF_COMPLIANCE_UNOFFICIAL) {
if (st->codec->codec_id == AV_CODEC_ID_MJPEG) {
p = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_NONE };
p = mjpeg_formats;
} else if (st->codec->codec_id == AV_CODEC_ID_LJPEG) {
p = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUV420P,
AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_BGRA, AV_PIX_FMT_NONE };
p =ljpeg_formats;
}
}
for (; *p != AV_PIX_FMT_NONE; p++) {

View File

@ -1021,6 +1021,7 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
input_streams[source_index]->discard = 0;
input_streams[source_index]->st->discard = AVDISCARD_NONE;
}
ost->last_mux_dts = AV_NOPTS_VALUE;
return ost;
}
@ -1143,8 +1144,6 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, in
if (p) p++;
}
video_enc->rc_override_count = i;
if (!video_enc->rc_initial_buffer_occupancy)
video_enc->rc_initial_buffer_occupancy = video_enc->rc_buffer_size * 3 / 4;
video_enc->intra_dc_precision = intra_dc_precision - 8;
if (do_psnr)
@ -1155,9 +1154,11 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, in
if (do_pass) {
if (do_pass & 1) {
video_enc->flags |= CODEC_FLAG_PASS1;
av_dict_set(&ost->opts, "flags", "+pass1", AV_DICT_APPEND);
}
if (do_pass & 2) {
video_enc->flags |= CODEC_FLAG_PASS2;
av_dict_set(&ost->opts, "flags", "+pass2", AV_DICT_APPEND);
}
}
@ -1824,7 +1825,8 @@ static int opt_target(void *optctx, const char *opt, const char *arg)
for (j = 0; j < nb_input_files; j++) {
for (i = 0; i < input_files[j]->nb_streams; i++) {
AVCodecContext *c = input_files[j]->ctx->streams[i]->codec;
if (c->codec_type != AVMEDIA_TYPE_VIDEO)
if (c->codec_type != AVMEDIA_TYPE_VIDEO ||
!c->time_base.num)
continue;
fr = c->time_base.den * 1000 / c->time_base.num;
if (fr == 25000) {
@ -1938,6 +1940,10 @@ static int opt_target(void *optctx, const char *opt, const char *arg)
av_log(NULL, AV_LOG_ERROR, "Unknown target: %s\n", arg);
return AVERROR(EINVAL);
}
av_dict_copy(&o->g->codec_opts, codec_opts, 0);
av_dict_copy(&o->g->format_opts, format_opts, 0);
return 0;
}
@ -2150,7 +2156,7 @@ static int opt_channel_layout(void *optctx, const char *opt, const char *arg)
return AVERROR(EINVAL);
}
snprintf(layout_str, sizeof(layout_str), "%"PRIu64, layout);
ret = opt_default(NULL, opt, layout_str);
ret = opt_default_new(o, opt, layout_str);
if (ret < 0)
return ret;

View File

@ -328,6 +328,14 @@ static AVLFG random_state;
static FILE *logfile = NULL;
static void htmlstrip(char *s) {
while (s && *s) {
s += strspn(s, "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,. ");
if (*s)
*s++ = '?';
}
}
static int64_t ffm_read_write_index(int fd)
{
uint8_t buf[8];
@ -1887,6 +1895,7 @@ static int http_parse_request(HTTPContext *c)
send_error:
c->http_error = 404;
q = c->buffer;
htmlstrip(msg);
snprintf(q, c->buffer_size,
"HTTP/1.0 404 Not Found\r\n"
"Content-type: text/html\r\n"

View File

@ -44,7 +44,7 @@ static av_cold int zero12v_decode_init(AVCodecContext *avctx)
static int zero12v_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame, AVPacket *avpkt)
{
int line = 0;
int line, ret;
const int width = avctx->width;
AVFrame *pic = avctx->coded_frame;
uint16_t *y, *u, *v;
@ -54,8 +54,8 @@ static int zero12v_decode_frame(AVCodecContext *avctx, void *data,
if (pic->data[0])
avctx->release_buffer(avctx, pic);
if (width == 1) {
av_log(avctx, AV_LOG_ERROR, "Width 1 not supported.\n");
if (width <= 1 || avctx->height <= 0) {
av_log(avctx, AV_LOG_ERROR, "Dimensions %dx%d not supported.\n", width, avctx->height);
return AVERROR_INVALIDDATA;
}
if (avpkt->size < avctx->height * stride) {
@ -65,48 +65,48 @@ static int zero12v_decode_frame(AVCodecContext *avctx, void *data,
}
pic->reference = 0;
if (ff_get_buffer(avctx, pic) < 0)
return AVERROR_INVALIDDATA;;
if ((ret = ff_get_buffer(avctx, pic)) < 0)
return ret;
y = (uint16_t *)pic->data[0];
u = (uint16_t *)pic->data[1];
v = (uint16_t *)pic->data[2];
line_end = avpkt->data + stride;
for (line = 0; line < avctx->height; line++) {
uint16_t y_temp[6] = {0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000};
uint16_t u_temp[3] = {0x8000, 0x8000, 0x8000};
uint16_t v_temp[3] = {0x8000, 0x8000, 0x8000};
int x;
y = (uint16_t *)(pic->data[0] + line * pic->linesize[0]);
u = (uint16_t *)(pic->data[1] + line * pic->linesize[1]);
v = (uint16_t *)(pic->data[2] + line * pic->linesize[2]);
while (line++ < avctx->height) {
while (1) {
uint32_t t = AV_RL32(src);
for (x = 0; x < width; x += 6) {
uint32_t t;
if (width - x < 6 || line_end - src < 16) {
y = y_temp;
u = u_temp;
v = v_temp;
}
if (line_end - src < 4)
break;
t = AV_RL32(src);
src += 4;
*u++ = t << 6 & 0xFFC0;
*y++ = t >> 4 & 0xFFC0;
*v++ = t >> 14 & 0xFFC0;
if (src >= line_end - 1) {
*y = 0x80;
src++;
line_end += stride;
y = (uint16_t *)(pic->data[0] + line * pic->linesize[0]);
u = (uint16_t *)(pic->data[1] + line * pic->linesize[1]);
v = (uint16_t *)(pic->data[2] + line * pic->linesize[2]);
if (line_end - src < 4)
break;
}
t = AV_RL32(src);
src += 4;
*y++ = t << 6 & 0xFFC0;
*u++ = t >> 4 & 0xFFC0;
*y++ = t >> 14 & 0xFFC0;
if (src >= line_end - 2) {
if (!(width & 1)) {
*y = 0x80;
src += 2;
}
line_end += stride;
y = (uint16_t *)(pic->data[0] + line * pic->linesize[0]);
u = (uint16_t *)(pic->data[1] + line * pic->linesize[1]);
v = (uint16_t *)(pic->data[2] + line * pic->linesize[2]);
if (line_end - src < 4)
break;
}
t = AV_RL32(src);
src += 4;
@ -114,15 +114,8 @@ static int zero12v_decode_frame(AVCodecContext *avctx, void *data,
*y++ = t >> 4 & 0xFFC0;
*u++ = t >> 14 & 0xFFC0;
if (src >= line_end - 1) {
*y = 0x80;
src++;
line_end += stride;
y = (uint16_t *)(pic->data[0] + line * pic->linesize[0]);
u = (uint16_t *)(pic->data[1] + line * pic->linesize[1]);
v = (uint16_t *)(pic->data[2] + line * pic->linesize[2]);
if (line_end - src < 4)
break;
}
t = AV_RL32(src);
src += 4;
@ -130,18 +123,21 @@ static int zero12v_decode_frame(AVCodecContext *avctx, void *data,
*v++ = t >> 4 & 0xFFC0;
*y++ = t >> 14 & 0xFFC0;
if (src >= line_end - 2) {
if (width & 1) {
*y = 0x80;
src += 2;
}
line_end += stride;
y = (uint16_t *)(pic->data[0] + line * pic->linesize[0]);
u = (uint16_t *)(pic->data[1] + line * pic->linesize[1]);
v = (uint16_t *)(pic->data[2] + line * pic->linesize[2]);
if (width - x < 6)
break;
}
}
if (x < width) {
y = x + (uint16_t *)(pic->data[0] + line * pic->linesize[0]);
u = x/2 + (uint16_t *)(pic->data[1] + line * pic->linesize[1]);
v = x/2 + (uint16_t *)(pic->data[2] + line * pic->linesize[2]);
memcpy(y, y_temp, sizeof(*y) * (width - x));
memcpy(u, u_temp, sizeof(*u) * (width - x + 1) / 2);
memcpy(v, v_temp, sizeof(*v) * (width - x + 1) / 2);
}
line_end += stride;
src = line_end - stride;
}
*got_frame = 1;

View File

@ -328,12 +328,12 @@ static inline void mcdc(uint16_t *dst, const uint16_t *src, int log2w,
}
break;
default:
av_assert2(0);
av_assert0(0);
}
}
static void decode_p_block(FourXContext *f, uint16_t *dst, uint16_t *src,
int log2w, int log2h, int stride)
static int decode_p_block(FourXContext *f, uint16_t *dst, uint16_t *src,
int log2w, int log2h, int stride)
{
const int index = size2index[log2h][log2w];
const int h = 1 << log2h;
@ -342,57 +342,72 @@ static void decode_p_block(FourXContext *f, uint16_t *dst, uint16_t *src,
BLOCK_TYPE_VLC_BITS, 1);
uint16_t *start = (uint16_t *)f->last_picture.data[0];
uint16_t *end = start + stride * (f->avctx->height - h + 1) - (1 << log2w);
int ret;
av_assert2(code >= 0 && code <= 6);
av_assert0(code >= 0 && code <= 6 && log2w >= 0);
if (code == 0) {
if (bytestream2_get_bytes_left(&f->g) < 1) {
av_log(f->avctx, AV_LOG_ERROR, "bytestream overread\n");
return;
return AVERROR_INVALIDDATA;
}
src += f->mv[bytestream2_get_byteu(&f->g)];
if (start > src || src > end) {
av_log(f->avctx, AV_LOG_ERROR, "mv out of pic\n");
return;
return AVERROR_INVALIDDATA;
}
mcdc(dst, src, log2w, h, stride, 1, 0);
} else if (code == 1) {
log2h--;
decode_p_block(f, dst, src, log2w, log2h, stride);
decode_p_block(f, dst + (stride << log2h),
src + (stride << log2h), log2w, log2h, stride);
if ((ret = decode_p_block(f, dst, src, log2w, log2h, stride)) < 0)
return ret;
if ((ret = decode_p_block(f, dst + (stride << log2h),
src + (stride << log2h),
log2w, log2h, stride)) < 0)
return ret;
} else if (code == 2) {
log2w--;
decode_p_block(f, dst , src, log2w, log2h, stride);
decode_p_block(f, dst + (1 << log2w),
src + (1 << log2w), log2w, log2h, stride);
if ((ret = decode_p_block(f, dst , src, log2w, log2h, stride)) < 0)
return ret;
if ((ret = decode_p_block(f, dst + (1 << log2w),
src + (1 << log2w),
log2w, log2h, stride)) < 0)
return ret;
} else if (code == 3 && f->version < 2) {
if (start > src || src > end) {
av_log(f->avctx, AV_LOG_ERROR, "mv out of pic\n");
return AVERROR_INVALIDDATA;
}
mcdc(dst, src, log2w, h, stride, 1, 0);
} else if (code == 4) {
if (bytestream2_get_bytes_left(&f->g) < 1) {
av_log(f->avctx, AV_LOG_ERROR, "bytestream overread\n");
return;
return AVERROR_INVALIDDATA;
}
src += f->mv[bytestream2_get_byteu(&f->g)];
if (start > src || src > end) {
av_log(f->avctx, AV_LOG_ERROR, "mv out of pic\n");
return;
return AVERROR_INVALIDDATA;
}
if (bytestream2_get_bytes_left(&f->g2) < 2){
av_log(f->avctx, AV_LOG_ERROR, "wordstream overread\n");
return;
return AVERROR_INVALIDDATA;
}
mcdc(dst, src, log2w, h, stride, 1, bytestream2_get_le16u(&f->g2));
} else if (code == 5) {
if (bytestream2_get_bytes_left(&f->g2) < 2) {
av_log(f->avctx, AV_LOG_ERROR, "wordstream overread\n");
return;
return AVERROR_INVALIDDATA;
}
if (start > src || src > end) {
av_log(f->avctx, AV_LOG_ERROR, "mv out of pic\n");
return AVERROR_INVALIDDATA;
}
mcdc(dst, src, log2w, h, stride, 0, bytestream2_get_le16u(&f->g2));
} else if (code == 6) {
if (bytestream2_get_bytes_left(&f->g2) < 4) {
av_log(f->avctx, AV_LOG_ERROR, "wordstream overread\n");
return;
return AVERROR_INVALIDDATA;
}
if (log2w) {
dst[0] = bytestream2_get_le16u(&f->g2);
@ -402,6 +417,7 @@ static void decode_p_block(FourXContext *f, uint16_t *dst, uint16_t *src,
dst[stride] = bytestream2_get_le16u(&f->g2);
}
}
return 0;
}
static int decode_p_frame(FourXContext *f, const uint8_t *buf, int length)
@ -414,8 +430,20 @@ static int decode_p_frame(FourXContext *f, const uint8_t *buf, int length)
const int stride = f->current_picture.linesize[0] >> 1;
unsigned int bitstream_size, bytestream_size, wordstream_size, extra,
bytestream_offset, wordstream_offset;
int ret;
if (!f->last_picture.data[0]) {
if ((ret = ff_get_buffer(f->avctx, &f->last_picture)) < 0) {
av_log(f->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}
for (y=0; y<f->avctx->height; y++)
memset(f->last_picture.data[0] + y*f->last_picture.linesize[0], 0, 2*f->avctx->width);
}
if (f->version > 1) {
if (length < 20)
return AVERROR_INVALIDDATA;
extra = 20;
if (length < extra)
return -1;
@ -459,7 +487,8 @@ static int decode_p_frame(FourXContext *f, const uint8_t *buf, int length)
for (y = 0; y < height; y += 8) {
for (x = 0; x < width; x += 8)
decode_p_block(f, dst + x, src + x, 3, 3, stride);
if ((ret = decode_p_block(f, dst + x, src + x, 3, 3, stride)) < 0)
return ret;
src += 8 * stride;
dst += 8 * stride;
}
@ -579,7 +608,8 @@ static int decode_i_mb(FourXContext *f)
}
static const uint8_t *read_huffman_tables(FourXContext *f,
const uint8_t * const buf, int buf_size)
const uint8_t * const buf,
int buf_size)
{
int frequency[512] = { 0 };
uint8_t flag[512];
@ -598,8 +628,11 @@ static const uint8_t *read_huffman_tables(FourXContext *f,
for (;;) {
int i;
if (start <= end && ptr_end - ptr < end - start + 1 + 1)
if (ptr_end - ptr < FFMAX(end - start + 1, 0) + 1) {
av_log(f->avctx, AV_LOG_ERROR, "invalid data in read_huffman_tables\n");
return NULL;
}
for (i = start; i <= end; i++)
frequency[i] = *ptr++;
start = *ptr++;
@ -701,9 +734,9 @@ static int decode_i2_frame(FourXContext *f, const uint8_t *buf, int length)
color[1] = bytestream2_get_le16u(&g3);
if (color[0] & 0x8000)
av_log(NULL, AV_LOG_ERROR, "unk bit 1\n");
av_log(f->avctx, AV_LOG_ERROR, "unk bit 1\n");
if (color[1] & 0x8000)
av_log(NULL, AV_LOG_ERROR, "unk bit 2\n");
av_log(f->avctx, AV_LOG_ERROR, "unk bit 2\n");
color[2] = mix(color[0], color[1]);
color[3] = mix(color[1], color[0]);
@ -732,7 +765,10 @@ static int decode_i_frame(FourXContext *f, const uint8_t *buf, int length)
unsigned int prestream_size;
const uint8_t *prestream;
if (bitstream_size > (1<<26) || length < bitstream_size + 12) {
if (bitstream_size > (1 << 26))
return AVERROR_INVALIDDATA;
if (length < bitstream_size + 12) {
av_log(f->avctx, AV_LOG_ERROR, "packet size too small\n");
return AVERROR_INVALIDDATA;
}
@ -741,16 +777,17 @@ static int decode_i_frame(FourXContext *f, const uint8_t *buf, int length)
prestream = buf + bitstream_size + 12;
if (prestream_size + bitstream_size + 12 != length
|| bitstream_size > (1 << 26)
|| prestream_size > (1 << 26)) {
av_log(f->avctx, AV_LOG_ERROR, "size mismatch %d %d %d\n",
prestream_size, bitstream_size, length);
return -1;
}
prestream = read_huffman_tables(f, prestream, buf + length - prestream);
if (!prestream)
return -1;
prestream = read_huffman_tables(f, prestream, prestream_size);
if (!prestream) {
av_log(f->avctx, AV_LOG_ERROR, "Error reading Huffman tables.\n");
return AVERROR_INVALIDDATA;
}
init_get_bits(&f->gb, buf + 4, 8 * bitstream_size);
@ -793,30 +830,38 @@ static int decode_frame(AVCodecContext *avctx, void *data,
AVFrame *p, temp;
int i, frame_4cc, frame_size;
if (buf_size < 12)
if (buf_size < 20)
return AVERROR_INVALIDDATA;
frame_4cc = AV_RL32(buf);
if (buf_size != AV_RL32(buf + 4) + 8 || buf_size < 20)
av_assert0(avctx->width % 16 == 0 && avctx->height % 16 == 0);
if (buf_size < AV_RL32(buf + 4) + 8) {
av_log(f->avctx, AV_LOG_ERROR, "size mismatch %d %d\n",
buf_size, AV_RL32(buf + 4));
return AVERROR_INVALIDDATA;
}
frame_4cc = AV_RL32(buf);
if (frame_4cc == AV_RL32("cfrm")) {
int free_index = -1;
int id, whole_size;
const int data_size = buf_size - 20;
const int id = AV_RL32(buf + 12);
const int whole_size = AV_RL32(buf + 16);
CFrameBuffer *cfrm;
if (data_size < 0 || whole_size < 0) {
av_log(f->avctx, AV_LOG_ERROR, "sizes invalid\n");
return AVERROR_INVALIDDATA;
}
if (f->version <= 1) {
av_log(f->avctx, AV_LOG_ERROR, "cfrm in version %d\n", f->version);
return AVERROR_INVALIDDATA;
}
id = AV_RL32(buf + 12);
whole_size = AV_RL32(buf + 16);
if (data_size < 0 || whole_size < 0) {
av_log(f->avctx, AV_LOG_ERROR, "sizes invalid\n");
return AVERROR_INVALIDDATA;
}
for (i = 0; i < CFRAME_BUFFER_COUNT; i++)
if (f->cfrm[i].id && f->cfrm[i].id < avctx->frame_number)
av_log(f->avctx, AV_LOG_ERROR, "lost c frame %d\n",
@ -857,6 +902,9 @@ static int decode_frame(AVCodecContext *avctx, void *data,
av_log(f->avctx, AV_LOG_ERROR, "cframe id mismatch %d %d\n",
id, avctx->frame_number);
if (f->version <= 1)
return AVERROR_INVALIDDATA;
cfrm->size = cfrm->id = 0;
frame_4cc = AV_RL32("pfrm");
} else
@ -895,16 +943,6 @@ static int decode_frame(AVCodecContext *avctx, void *data,
return -1;
}
} else if (frame_4cc == AV_RL32("pfrm") || frame_4cc == AV_RL32("pfr2")) {
if (!f->last_picture.data[0]) {
f->last_picture.reference = 3;
if (ff_get_buffer(avctx, &f->last_picture) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;
}
for (i=0; i<avctx->height; i++)
memset(f->last_picture.data[0] + i*f->last_picture.linesize[0], 0, 2*avctx->width);
}
p->pict_type = AV_PICTURE_TYPE_P;
if (decode_p_frame(f, buf, frame_size) < 0) {
av_log(f->avctx, AV_LOG_ERROR, "decode p frame failed\n");

View File

@ -64,7 +64,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
unsigned char *pixptr, *pixptr_end;
unsigned int height = avctx->height; // Real image height
unsigned int dlen, p, row;
const unsigned char *lp, *dp;
const unsigned char *lp, *dp, *ep;
unsigned char count;
unsigned int planes = c->planes;
unsigned char *planemap = c->planemap;
@ -79,6 +79,8 @@ static int decode_frame(AVCodecContext *avctx, void *data,
return -1;
}
ep = encoded + buf_size;
/* Set data pointer after line lengths */
dp = encoded + planes * (height << 1);
@ -90,19 +92,19 @@ static int decode_frame(AVCodecContext *avctx, void *data,
for (row = 0; row < height; row++) {
pixptr = c->pic.data[0] + row * c->pic.linesize[0] + planemap[p];
pixptr_end = pixptr + c->pic.linesize[0];
if(lp - encoded + row*2 + 1 >= buf_size)
return -1;
if (ep - lp < row * 2 + 2)
return AVERROR_INVALIDDATA;
dlen = av_be2ne16(*(const unsigned short *)(lp + row * 2));
/* Decode a row of this plane */
while (dlen > 0) {
if (dp + 1 >= buf + buf_size)
if (ep - dp <= 1)
return -1;
if ((count = *dp++) <= 127) {
count++;
dlen -= count + 1;
if (pixptr + count * planes > pixptr_end)
break;
if (dp + count > buf + buf_size)
if (ep - dp < count)
return -1;
while (count--) {
*pixptr = *dp++;

View File

@ -25,7 +25,6 @@ OBJS = allcodecs.o \
fmtconvert.o \
imgconvert.o \
jrevdct.o \
log2_tab.o \
mathtables.o \
options.o \
parser.o \
@ -39,6 +38,7 @@ OBJS = allcodecs.o \
# parts needed for many different codecs
OBJS-$(CONFIG_AANDCTTABLES) += aandcttab.o
OBJS-$(CONFIG_AC3DSP) += ac3dsp.o
OBJS-$(CONFIG_AUDIO_FRAME_QUEUE) += audio_frame_queue.o
OBJS-$(CONFIG_CRYSTALHD) += crystalhd.o
OBJS-$(CONFIG_DCT) += dct.o dct32_fixed.o dct32_float.o
OBJS-$(CONFIG_DWT) += dwt.o snow.o
@ -68,6 +68,7 @@ OBJS-$(CONFIG_MPEGVIDEOENC) += mpegvideo_enc.o mpeg12data.o \
OBJS-$(CONFIG_RANGECODER) += rangecoder.o
RDFT-OBJS-$(CONFIG_HARDCODED_TABLES) += sin_tables.o
OBJS-$(CONFIG_RDFT) += rdft.o $(RDFT-OBJS-yes)
OBJS-$(CONFIG_SHARED) += log2_tab.o
OBJS-$(CONFIG_SINEWIN) += sinewin.o
OBJS-$(CONFIG_VAAPI) += vaapi.o
OBJS-$(CONFIG_VDPAU) += vdpau.o
@ -84,8 +85,7 @@ OBJS-$(CONFIG_AAC_DECODER) += aacdec.o aactab.o aacsbr.o aacps.o \
OBJS-$(CONFIG_AAC_ENCODER) += aacenc.o aaccoder.o \
aacpsy.o aactab.o \
psymodel.o iirfilter.o \
mpeg4audio.o kbdwin.o \
audio_frame_queue.o
mpeg4audio.o kbdwin.o
OBJS-$(CONFIG_AASC_DECODER) += aasc.o msrledec.o
OBJS-$(CONFIG_AC3_DECODER) += ac3dec.o ac3dec_data.o ac3.o kbdwin.o
OBJS-$(CONFIG_AC3_ENCODER) += ac3enc_float.o ac3enc.o ac3tab.o \
@ -317,8 +317,7 @@ OBJS-$(CONFIG_MVC1_DECODER) += mvcdec.o
OBJS-$(CONFIG_MVC2_DECODER) += mvcdec.o
OBJS-$(CONFIG_MXPEG_DECODER) += mxpegdec.o mjpegdec.o mjpeg.o
OBJS-$(CONFIG_NELLYMOSER_DECODER) += nellymoserdec.o nellymoser.o
OBJS-$(CONFIG_NELLYMOSER_ENCODER) += nellymoserenc.o nellymoser.o \
audio_frame_queue.o
OBJS-$(CONFIG_NELLYMOSER_ENCODER) += nellymoserenc.o nellymoser.o
OBJS-$(CONFIG_NUV_DECODER) += nuv.o rtjpeg.o
OBJS-$(CONFIG_PAF_VIDEO_DECODER) += paf.o
OBJS-$(CONFIG_PAF_AUDIO_DECODER) += paf.o
@ -358,8 +357,7 @@ OBJS-$(CONFIG_R10K_ENCODER) += r210enc.o
OBJS-$(CONFIG_R210_DECODER) += r210dec.o
OBJS-$(CONFIG_R210_ENCODER) += r210enc.o
OBJS-$(CONFIG_RA_144_DECODER) += ra144dec.o ra144.o celp_filters.o
OBJS-$(CONFIG_RA_144_ENCODER) += ra144enc.o ra144.o celp_filters.o \
audio_frame_queue.o
OBJS-$(CONFIG_RA_144_ENCODER) += ra144enc.o ra144.o celp_filters.o
OBJS-$(CONFIG_RA_288_DECODER) += ra288.o celp_filters.o
OBJS-$(CONFIG_RALF_DECODER) += ralf.o
OBJS-$(CONFIG_RAWVIDEO_DECODER) += rawdec.o
@ -660,43 +658,39 @@ OBJS-$(CONFIG_WTV_DEMUXER) += mpeg4audio.o mpegaudiodata.o
# external codec libraries
OBJS-$(CONFIG_LIBAACPLUS_ENCODER) += libaacplus.o
OBJS-$(CONFIG_LIBCELT_DECODER) += libcelt_dec.o
OBJS-$(CONFIG_LIBFAAC_ENCODER) += libfaac.o audio_frame_queue.o
OBJS-$(CONFIG_LIBFDK_AAC_ENCODER) += libfdk-aacenc.o audio_frame_queue.o
OBJS-$(CONFIG_LIBFAAC_ENCODER) += libfaac.o
OBJS-$(CONFIG_LIBFDK_AAC_ENCODER) += libfdk-aacenc.o
OBJS-$(CONFIG_LIBGSM_DECODER) += libgsm.o
OBJS-$(CONFIG_LIBGSM_ENCODER) += libgsm.o
OBJS-$(CONFIG_LIBGSM_MS_DECODER) += libgsm.o
OBJS-$(CONFIG_LIBGSM_MS_ENCODER) += libgsm.o
OBJS-$(CONFIG_LIBILBC_DECODER) += libilbc.o
OBJS-$(CONFIG_LIBILBC_ENCODER) += libilbc.o
OBJS-$(CONFIG_LIBMP3LAME_ENCODER) += libmp3lame.o mpegaudiodecheader.o \
audio_frame_queue.o
OBJS-$(CONFIG_LIBOPENCORE_AMRNB_DECODER) += libopencore-amr.o \
audio_frame_queue.o
OBJS-$(CONFIG_LIBOPENCORE_AMRNB_ENCODER) += libopencore-amr.o \
audio_frame_queue.o
OBJS-$(CONFIG_LIBMP3LAME_ENCODER) += libmp3lame.o mpegaudiodecheader.o
OBJS-$(CONFIG_LIBOPENCORE_AMRNB_DECODER) += libopencore-amr.o
OBJS-$(CONFIG_LIBOPENCORE_AMRNB_ENCODER) += libopencore-amr.o
OBJS-$(CONFIG_LIBOPENCORE_AMRWB_DECODER) += libopencore-amr.o
OBJS-$(CONFIG_LIBOPENJPEG_DECODER) += libopenjpegdec.o
OBJS-$(CONFIG_LIBOPENJPEG_ENCODER) += libopenjpegenc.o
OBJS-$(CONFIG_LIBOPUS_DECODER) += libopusdec.o libopus.o \
vorbis_data.o
OBJS-$(CONFIG_LIBOPUS_ENCODER) += libopusenc.o libopus.o \
vorbis_data.o audio_frame_queue.o
vorbis_data.o
OBJS-$(CONFIG_LIBSCHROEDINGER_DECODER) += libschroedingerdec.o \
libschroedinger.o
OBJS-$(CONFIG_LIBSCHROEDINGER_ENCODER) += libschroedingerenc.o \
libschroedinger.o
OBJS-$(CONFIG_LIBSPEEX_DECODER) += libspeexdec.o
OBJS-$(CONFIG_LIBSPEEX_ENCODER) += libspeexenc.o audio_frame_queue.o
OBJS-$(CONFIG_LIBSPEEX_ENCODER) += libspeexenc.o
OBJS-$(CONFIG_LIBSTAGEFRIGHT_H264_DECODER)+= libstagefright.o
OBJS-$(CONFIG_LIBTHEORA_ENCODER) += libtheoraenc.o
OBJS-$(CONFIG_LIBTWOLAME_ENCODER) += libtwolame.o
OBJS-$(CONFIG_LIBUTVIDEO_DECODER) += libutvideodec.o
OBJS-$(CONFIG_LIBUTVIDEO_ENCODER) += libutvideoenc.o
OBJS-$(CONFIG_LIBVO_AACENC_ENCODER) += libvo-aacenc.o mpeg4audio.o \
audio_frame_queue.o
OBJS-$(CONFIG_LIBVO_AACENC_ENCODER) += libvo-aacenc.o mpeg4audio.o
OBJS-$(CONFIG_LIBVO_AMRWBENC_ENCODER) += libvo-amrwbenc.o
OBJS-$(CONFIG_LIBVORBIS_DECODER) += libvorbisdec.o
OBJS-$(CONFIG_LIBVORBIS_ENCODER) += libvorbisenc.o audio_frame_queue.o \
OBJS-$(CONFIG_LIBVORBIS_ENCODER) += libvorbisenc.o \
vorbis_data.o vorbis_parser.o xiph.o
OBJS-$(CONFIG_LIBVPX_DECODER) += libvpxdec.o
OBJS-$(CONFIG_LIBVPX_ENCODER) += libvpxenc.o

View File

@ -57,9 +57,13 @@ static void to_meta_with_crop(AVCodecContext *avctx, AVFrame *p, int *dest)
for (y = blocky; y < blocky + 8 && y < C64YRES; y++) {
for (x = blockx; x < blockx + 8 && x < C64XRES; x += 2) {
if(x < width && y < height) {
/* build average over 2 pixels */
luma = (src[(x + 0 + y * p->linesize[0])] +
src[(x + 1 + y * p->linesize[0])]) / 2;
if (x + 1 < width) {
/* build average over 2 pixels */
luma = (src[(x + 0 + y * p->linesize[0])] +
src[(x + 1 + y * p->linesize[0])]) / 2;
} else {
luma = src[(x + y * p->linesize[0])];
}
/* write blocks as linear data now so they are suitable for elbg */
dest[0] = luma;
}

View File

@ -28,13 +28,13 @@
#include "parser.h"
typedef enum {
AAC_AC3_PARSE_ERROR_SYNC = -1,
AAC_AC3_PARSE_ERROR_BSID = -2,
AAC_AC3_PARSE_ERROR_SAMPLE_RATE = -3,
AAC_AC3_PARSE_ERROR_FRAME_SIZE = -4,
AAC_AC3_PARSE_ERROR_FRAME_TYPE = -5,
AAC_AC3_PARSE_ERROR_CRC = -6,
AAC_AC3_PARSE_ERROR_CHANNEL_CFG = -7,
AAC_AC3_PARSE_ERROR_SYNC = -0x1030c0a,
AAC_AC3_PARSE_ERROR_BSID = -0x2030c0a,
AAC_AC3_PARSE_ERROR_SAMPLE_RATE = -0x3030c0a,
AAC_AC3_PARSE_ERROR_FRAME_SIZE = -0x4030c0a,
AAC_AC3_PARSE_ERROR_FRAME_TYPE = -0x5030c0a,
AAC_AC3_PARSE_ERROR_CRC = -0x6030c0a,
AAC_AC3_PARSE_ERROR_CHANNEL_CFG = -0x7030c0a,
} AACAC3ParseError;
typedef struct AACAC3ParseContext {

View File

@ -34,7 +34,7 @@ static int aac_sync(uint64_t state, AACAC3ParseContext *hdr_info,
int size;
union {
uint64_t u64;
uint8_t u8[8];
uint8_t u8[8 + FF_INPUT_BUFFER_PADDING_SIZE];
} tmp;
tmp.u64 = av_be2ne64(state);

View File

@ -710,7 +710,7 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx,
const float lambda)
{
int start = 0, i, w, w2, g;
int destbits = avctx->bit_rate * 1024.0 / avctx->sample_rate / avctx->channels;
int destbits = avctx->bit_rate * 1024.0 / avctx->sample_rate / avctx->channels * (lambda / 120.f);
float dists[128] = { 0 }, uplims[128];
float maxvals[128];
int fflag, minscaler;

View File

@ -113,6 +113,10 @@
static VLC vlc_scalefactors;
static VLC vlc_spectral[11];
static int output_configure(AACContext *ac,
uint8_t layout_map[MAX_ELEM_ID*4][3], int tags,
enum OCStatus oc_type, int get_new_frame);
#define overread_err "Input buffer exhausted before END element found\n"
static int count_channels(uint8_t (*layout)[3], int tags)
@ -143,6 +147,8 @@ static av_cold int che_configure(AACContext *ac,
enum ChannelPosition che_pos,
int type, int id, int *channels)
{
if (*channels >= MAX_CHANNELS)
return AVERROR_INVALIDDATA;
if (che_pos) {
if (!ac->che[type][id]) {
if (!(ac->che[type][id] = av_mallocz(sizeof(ChannelElement))))
@ -184,6 +190,9 @@ static int frame_configure_elements(AVCodecContext *avctx)
}
}
if (!avctx->channels)
return 1;
/* get output buffer */
ac->frame.nb_samples = 2048;
if ((ret = ff_get_buffer(avctx, &ac->frame)) < 0) {
@ -209,28 +218,39 @@ struct elem_to_channel {
static int assign_pair(struct elem_to_channel e2c_vec[MAX_ELEM_ID],
uint8_t (*layout_map)[3], int offset, uint64_t left,
uint64_t right, int pos)
uint64_t right, int pos)
{
if (layout_map[offset][0] == TYPE_CPE) {
e2c_vec[offset] = (struct elem_to_channel) {
.av_position = left | right, .syn_ele = TYPE_CPE,
.elem_id = layout_map[offset ][1], .aac_position = pos };
.av_position = left | right,
.syn_ele = TYPE_CPE,
.elem_id = layout_map[offset][1],
.aac_position = pos
};
return 1;
} else {
e2c_vec[offset] = (struct elem_to_channel) {
.av_position = left, .syn_ele = TYPE_SCE,
.elem_id = layout_map[offset ][1], .aac_position = pos };
e2c_vec[offset] = (struct elem_to_channel) {
.av_position = left,
.syn_ele = TYPE_SCE,
.elem_id = layout_map[offset][1],
.aac_position = pos
};
e2c_vec[offset + 1] = (struct elem_to_channel) {
.av_position = right, .syn_ele = TYPE_SCE,
.elem_id = layout_map[offset + 1][1], .aac_position = pos };
.av_position = right,
.syn_ele = TYPE_SCE,
.elem_id = layout_map[offset + 1][1],
.aac_position = pos
};
return 2;
}
}
static int count_paired_channels(uint8_t (*layout_map)[3], int tags, int pos, int *current) {
static int count_paired_channels(uint8_t (*layout_map)[3], int tags, int pos,
int *current)
{
int num_pos_channels = 0;
int first_cpe = 0;
int sce_parity = 0;
int first_cpe = 0;
int sce_parity = 0;
int i;
for (i = *current; i < tags; i++) {
if (layout_map[i][2] != pos)
@ -244,7 +264,7 @@ static int count_paired_channels(uint8_t (*layout_map)[3], int tags, int pos, in
}
}
num_pos_channels += 2;
first_cpe = 1;
first_cpe = 1;
} else {
num_pos_channels++;
sce_parity ^= 1;
@ -252,7 +272,7 @@ static int count_paired_channels(uint8_t (*layout_map)[3], int tags, int pos, in
}
if (sce_parity &&
((pos == AAC_CHANNEL_FRONT && first_cpe) || pos == AAC_CHANNEL_SIDE))
return -1;
return -1;
*current = i;
return num_pos_channels;
}
@ -260,7 +280,7 @@ static int count_paired_channels(uint8_t (*layout_map)[3], int tags, int pos, in
static uint64_t sniff_channel_order(uint8_t (*layout_map)[3], int tags)
{
int i, n, total_non_cc_elements;
struct elem_to_channel e2c_vec[4*MAX_ELEM_ID] = {{ 0 }};
struct elem_to_channel e2c_vec[4 * MAX_ELEM_ID] = { { 0 } };
int num_front_channels, num_side_channels, num_back_channels;
uint64_t layout;
@ -284,8 +304,11 @@ static uint64_t sniff_channel_order(uint8_t (*layout_map)[3], int tags)
i = 0;
if (num_front_channels & 1) {
e2c_vec[i] = (struct elem_to_channel) {
.av_position = AV_CH_FRONT_CENTER, .syn_ele = TYPE_SCE,
.elem_id = layout_map[i][1], .aac_position = AAC_CHANNEL_FRONT };
.av_position = AV_CH_FRONT_CENTER,
.syn_ele = TYPE_SCE,
.elem_id = layout_map[i][1],
.aac_position = AAC_CHANNEL_FRONT
};
i++;
num_front_channels--;
}
@ -342,22 +365,31 @@ static uint64_t sniff_channel_order(uint8_t (*layout_map)[3], int tags)
}
if (num_back_channels) {
e2c_vec[i] = (struct elem_to_channel) {
.av_position = AV_CH_BACK_CENTER, .syn_ele = TYPE_SCE,
.elem_id = layout_map[i][1], .aac_position = AAC_CHANNEL_BACK };
.av_position = AV_CH_BACK_CENTER,
.syn_ele = TYPE_SCE,
.elem_id = layout_map[i][1],
.aac_position = AAC_CHANNEL_BACK
};
i++;
num_back_channels--;
}
if (i < tags && layout_map[i][2] == AAC_CHANNEL_LFE) {
e2c_vec[i] = (struct elem_to_channel) {
.av_position = AV_CH_LOW_FREQUENCY, .syn_ele = TYPE_LFE,
.elem_id = layout_map[i][1], .aac_position = AAC_CHANNEL_LFE };
.av_position = AV_CH_LOW_FREQUENCY,
.syn_ele = TYPE_LFE,
.elem_id = layout_map[i][1],
.aac_position = AAC_CHANNEL_LFE
};
i++;
}
while (i < tags && layout_map[i][2] == AAC_CHANNEL_LFE) {
e2c_vec[i] = (struct elem_to_channel) {
.av_position = UINT64_MAX, .syn_ele = TYPE_LFE,
.elem_id = layout_map[i][1], .aac_position = AAC_CHANNEL_LFE };
.av_position = UINT64_MAX,
.syn_ele = TYPE_LFE,
.elem_id = layout_map[i][1],
.aac_position = AAC_CHANNEL_LFE
};
i++;
}
@ -365,12 +397,11 @@ static uint64_t sniff_channel_order(uint8_t (*layout_map)[3], int tags)
total_non_cc_elements = n = i;
do {
int next_n = 0;
for (i = 1; i < n; i++) {
if (e2c_vec[i-1].av_position > e2c_vec[i].av_position) {
FFSWAP(struct elem_to_channel, e2c_vec[i-1], e2c_vec[i]);
for (i = 1; i < n; i++)
if (e2c_vec[i - 1].av_position > e2c_vec[i].av_position) {
FFSWAP(struct elem_to_channel, e2c_vec[i - 1], e2c_vec[i]);
next_n = i;
}
}
n = next_n;
} while (n > 0);
@ -406,16 +437,19 @@ static void pop_output_configuration(AACContext *ac) {
ac->oc[1] = ac->oc[0];
ac->avctx->channels = ac->oc[1].channels;
ac->avctx->channel_layout = ac->oc[1].channel_layout;
output_configure(ac, ac->oc[1].layout_map, ac->oc[1].layout_map_tags,
ac->oc[1].status, 0);
}
}
/**
* Configure output channel order based on the current program configuration element.
* Configure output channel order based on the current program
* configuration element.
*
* @return Returns error status. 0 - OK, !0 - error
*/
static int output_configure(AACContext *ac,
uint8_t layout_map[MAX_ELEM_ID*4][3], int tags,
uint8_t layout_map[MAX_ELEM_ID * 4][3], int tags,
enum OCStatus oc_type, int get_new_frame)
{
AVCodecContext *avctx = ac->avctx;
@ -487,36 +521,40 @@ static void flush(AVCodecContext *avctx)
* @return Returns error status. 0 - OK, !0 - error
*/
static int set_default_channel_config(AVCodecContext *avctx,
uint8_t (*layout_map)[3],
int *tags,
int channel_config)
uint8_t (*layout_map)[3],
int *tags,
int channel_config)
{
if (channel_config < 1 || channel_config > 7) {
av_log(avctx, AV_LOG_ERROR, "invalid default channel configuration (%d)\n",
av_log(avctx, AV_LOG_ERROR,
"invalid default channel configuration (%d)\n",
channel_config);
return -1;
return AVERROR_INVALIDDATA;
}
*tags = tags_per_config[channel_config];
memcpy(layout_map, aac_channel_layout_map[channel_config-1], *tags * sizeof(*layout_map));
memcpy(layout_map, aac_channel_layout_map[channel_config - 1],
*tags * sizeof(*layout_map));
return 0;
}
static ChannelElement *get_che(AACContext *ac, int type, int elem_id)
{
// For PCE based channel configurations map the channels solely based on tags.
/* For PCE based channel configurations map the channels solely based
* on tags. */
if (!ac->oc[1].m4ac.chan_config) {
return ac->tag_che_map[type][elem_id];
}
// Allow single CPE stereo files to be signalled with mono configuration.
if (!ac->tags_mapped && type == TYPE_CPE && ac->oc[1].m4ac.chan_config == 1) {
if (!ac->tags_mapped && type == TYPE_CPE &&
ac->oc[1].m4ac.chan_config == 1) {
uint8_t layout_map[MAX_ELEM_ID*4][3];
int layout_map_tags;
push_output_configuration(ac);
av_log(ac->avctx, AV_LOG_DEBUG, "mono with CPE\n");
if (set_default_channel_config(ac->avctx, layout_map, &layout_map_tags,
2) < 0)
if (set_default_channel_config(ac->avctx, layout_map,
&layout_map_tags, 2) < 0)
return NULL;
if (output_configure(ac, layout_map, layout_map_tags,
OC_TRIAL_FRAME, 1) < 0)
@ -526,15 +564,16 @@ static ChannelElement *get_che(AACContext *ac, int type, int elem_id)
ac->oc[1].m4ac.ps = 0;
}
// And vice-versa
if (!ac->tags_mapped && type == TYPE_SCE && ac->oc[1].m4ac.chan_config == 2) {
uint8_t layout_map[MAX_ELEM_ID*4][3];
if (!ac->tags_mapped && type == TYPE_SCE &&
ac->oc[1].m4ac.chan_config == 2) {
uint8_t layout_map[MAX_ELEM_ID * 4][3];
int layout_map_tags;
push_output_configuration(ac);
av_log(ac->avctx, AV_LOG_DEBUG, "stereo with SCE\n");
if (set_default_channel_config(ac->avctx, layout_map, &layout_map_tags,
1) < 0)
if (set_default_channel_config(ac->avctx, layout_map,
&layout_map_tags, 1) < 0)
return NULL;
if (output_configure(ac, layout_map, layout_map_tags,
OC_TRIAL_FRAME, 1) < 0)
@ -544,7 +583,8 @@ static ChannelElement *get_che(AACContext *ac, int type, int elem_id)
if (ac->oc[1].m4ac.sbr)
ac->oc[1].m4ac.ps = -1;
}
// For indexed channel configurations map the channels solely based on position.
/* For indexed channel configurations map the channels solely based
* on position. */
switch (ac->oc[1].m4ac.chan_config) {
case 7:
if (ac->tags_mapped == 3 && type == TYPE_CPE) {
@ -552,9 +592,12 @@ static ChannelElement *get_che(AACContext *ac, int type, int elem_id)
return ac->tag_che_map[TYPE_CPE][elem_id] = ac->che[TYPE_CPE][2];
}
case 6:
/* Some streams incorrectly code 5.1 audio as SCE[0] CPE[0] CPE[1] SCE[1]
instead of SCE[0] CPE[0] CPE[1] LFE[0]. If we seem to have
encountered such a stream, transfer the LFE[0] element to the SCE[1]'s mapping */
/* Some streams incorrectly code 5.1 audio as
* SCE[0] CPE[0] CPE[1] SCE[1]
* instead of
* SCE[0] CPE[0] CPE[1] LFE[0].
* If we seem to have encountered such a stream, transfer
* the LFE[0] element to the SCE[1]'s mapping */
if (ac->tags_mapped == tags_per_config[ac->oc[1].m4ac.chan_config] - 1 && (type == TYPE_LFE || type == TYPE_SCE)) {
ac->tags_mapped++;
return ac->tag_che_map[type][elem_id] = ac->che[TYPE_LFE][0];
@ -565,13 +608,16 @@ static ChannelElement *get_che(AACContext *ac, int type, int elem_id)
return ac->tag_che_map[TYPE_CPE][elem_id] = ac->che[TYPE_CPE][1];
}
case 4:
if (ac->tags_mapped == 2 && ac->oc[1].m4ac.chan_config == 4 && type == TYPE_SCE) {
if (ac->tags_mapped == 2 &&
ac->oc[1].m4ac.chan_config == 4 &&
type == TYPE_SCE) {
ac->tags_mapped++;
return ac->tag_che_map[TYPE_SCE][elem_id] = ac->che[TYPE_SCE][1];
}
case 3:
case 2:
if (ac->tags_mapped == (ac->oc[1].m4ac.chan_config != 2) && type == TYPE_CPE) {
if (ac->tags_mapped == (ac->oc[1].m4ac.chan_config != 2) &&
type == TYPE_CPE) {
ac->tags_mapped++;
return ac->tag_che_map[TYPE_CPE][elem_id] = ac->che[TYPE_CPE][0];
} else if (ac->oc[1].m4ac.chan_config == 2) {
@ -588,7 +634,8 @@ static ChannelElement *get_che(AACContext *ac, int type, int elem_id)
}
/**
* Decode an array of 4 bit element IDs, optionally interleaved with a stereo/mono switching bit.
* Decode an array of 4 bit element IDs, optionally interleaved with a
* stereo/mono switching bit.
*
* @param type speaker type/position for these channels
*/
@ -630,7 +677,8 @@ static int decode_pce(AVCodecContext *avctx, MPEG4AudioConfig *m4ac,
uint8_t (*layout_map)[3],
GetBitContext *gb)
{
int num_front, num_side, num_back, num_lfe, num_assoc_data, num_cc, sampling_index;
int num_front, num_side, num_back, num_lfe, num_assoc_data, num_cc;
int sampling_index;
int comment_len;
int tags;
@ -638,7 +686,9 @@ static int decode_pce(AVCodecContext *avctx, MPEG4AudioConfig *m4ac,
sampling_index = get_bits(gb, 4);
if (m4ac->sampling_index != sampling_index)
av_log(avctx, AV_LOG_WARNING, "Sample rate index in program config element does not match the sample rate index configured by the container.\n");
av_log(avctx, AV_LOG_WARNING,
"Sample rate index in program config element does not "
"match the sample rate index configured by the container.\n");
num_front = get_bits(gb, 4);
num_side = get_bits(gb, 4);
@ -679,7 +729,7 @@ static int decode_pce(AVCodecContext *avctx, MPEG4AudioConfig *m4ac,
comment_len = get_bits(gb, 8) * 8;
if (get_bits_left(gb) < comment_len) {
av_log(avctx, AV_LOG_ERROR, "decode_pce: " overread_err);
return -1;
return AVERROR_INVALIDDATA;
}
skip_bits_long(gb, comment_len);
return tags;
@ -721,7 +771,8 @@ static int decode_ga_specific_config(AACContext *ac, AVCodecContext *avctx,
if (tags < 0)
return tags;
} else {
if ((ret = set_default_channel_config(avctx, layout_map, &tags, channel_config)))
if ((ret = set_default_channel_config(avctx, layout_map,
&tags, channel_config)))
return ret;
}
@ -743,7 +794,7 @@ static int decode_ga_specific_config(AACContext *ac, AVCodecContext *avctx,
case AOT_ER_AAC_LTP:
case AOT_ER_AAC_SCALABLE:
case AOT_ER_AAC_LD:
skip_bits(gb, 3); /* aacSectionDataResilienceFlag
skip_bits(gb, 3); /* aacSectionDataResilienceFlag
* aacScalefactorDataResilienceFlag
* aacSpectralDataResilienceFlag
*/
@ -773,20 +824,24 @@ static int decode_audio_specific_config(AACContext *ac,
int sync_extension)
{
GetBitContext gb;
int i;
int i, ret;
av_dlog(avctx, "audio specific config size %d\n", bit_size >> 3);
for (i = 0; i < bit_size >> 3; i++)
av_dlog(avctx, "%02x ", data[i]);
av_dlog(avctx, "\n");
init_get_bits(&gb, data, bit_size);
if ((ret = init_get_bits(&gb, data, bit_size)) < 0)
return ret;
if ((i = avpriv_mpeg4audio_get_config(m4ac, data, bit_size, sync_extension)) < 0)
return -1;
if ((i = avpriv_mpeg4audio_get_config(m4ac, data, bit_size,
sync_extension)) < 0)
return AVERROR_INVALIDDATA;
if (m4ac->sampling_index > 12) {
av_log(avctx, AV_LOG_ERROR, "invalid sampling rate index %d\n", m4ac->sampling_index);
return -1;
av_log(avctx, AV_LOG_ERROR,
"invalid sampling rate index %d\n",
m4ac->sampling_index);
return AVERROR_INVALIDDATA;
}
skip_bits_long(&gb, i);
@ -795,18 +850,23 @@ static int decode_audio_specific_config(AACContext *ac,
case AOT_AAC_MAIN:
case AOT_AAC_LC:
case AOT_AAC_LTP:
if (decode_ga_specific_config(ac, avctx, &gb, m4ac, m4ac->chan_config))
return -1;
if ((ret = decode_ga_specific_config(ac, avctx, &gb,
m4ac, m4ac->chan_config)) < 0)
return ret;
break;
default:
av_log(avctx, AV_LOG_ERROR, "Audio object type %s%d is not supported.\n",
m4ac->sbr == 1? "SBR+" : "", m4ac->object_type);
return -1;
av_log(avctx, AV_LOG_ERROR,
"Audio object type %s%d is not supported.\n",
m4ac->sbr == 1 ? "SBR+" : "",
m4ac->object_type);
return AVERROR(ENOSYS);
}
av_dlog(avctx, "AOT %d chan config %d sampling index %d (%d) SBR %d PS %d\n",
av_dlog(avctx,
"AOT %d chan config %d sampling index %d (%d) SBR %d PS %d\n",
m4ac->object_type, m4ac->chan_config, m4ac->sampling_index,
m4ac->sample_rate, m4ac->sbr, m4ac->ps);
m4ac->sample_rate, m4ac->sbr,
m4ac->ps);
return get_bits_count(&gb);
}
@ -864,15 +924,18 @@ static void reset_predictor_group(PredictorState *ps, int group_num)
reset_predict_state(&ps[i]);
}
#define AAC_INIT_VLC_STATIC(num, size) \
INIT_VLC_STATIC(&vlc_spectral[num], 8, ff_aac_spectral_sizes[num], \
ff_aac_spectral_bits[num], sizeof( ff_aac_spectral_bits[num][0]), sizeof( ff_aac_spectral_bits[num][0]), \
ff_aac_spectral_codes[num], sizeof(ff_aac_spectral_codes[num][0]), sizeof(ff_aac_spectral_codes[num][0]), \
#define AAC_INIT_VLC_STATIC(num, size) \
INIT_VLC_STATIC(&vlc_spectral[num], 8, ff_aac_spectral_sizes[num], \
ff_aac_spectral_bits[num], sizeof(ff_aac_spectral_bits[num][0]), \
sizeof(ff_aac_spectral_bits[num][0]), \
ff_aac_spectral_codes[num], sizeof(ff_aac_spectral_codes[num][0]), \
sizeof(ff_aac_spectral_codes[num][0]), \
size);
static av_cold int aac_decode_init(AVCodecContext *avctx)
{
AACContext *ac = avctx->priv_data;
int ret;
ac->avctx = avctx;
ac->oc[1].m4ac.sample_rate = avctx->sample_rate;
@ -880,10 +943,11 @@ static av_cold int aac_decode_init(AVCodecContext *avctx)
avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
if (avctx->extradata_size > 0) {
if (decode_audio_specific_config(ac, ac->avctx, &ac->oc[1].m4ac,
avctx->extradata,
avctx->extradata_size*8, 1) < 0)
return -1;
if ((ret = decode_audio_specific_config(ac, ac->avctx, &ac->oc[1].m4ac,
avctx->extradata,
avctx->extradata_size * 8,
1)) < 0)
return ret;
} else {
int sr, i;
uint8_t layout_map[MAX_ELEM_ID*4][3];
@ -914,6 +978,11 @@ static av_cold int aac_decode_init(AVCodecContext *avctx)
}
}
if (avctx->channels > MAX_CHANNELS) {
av_log(avctx, AV_LOG_ERROR, "Too many channels\n");
return AVERROR_INVALIDDATA;
}
AAC_INIT_VLC_STATIC( 0, 304);
AAC_INIT_VLC_STATIC( 1, 270);
AAC_INIT_VLC_STATIC( 2, 550);
@ -936,9 +1005,14 @@ static av_cold int aac_decode_init(AVCodecContext *avctx)
ff_aac_tableinit();
INIT_VLC_STATIC(&vlc_scalefactors,7,FF_ARRAY_ELEMS(ff_aac_scalefactor_code),
ff_aac_scalefactor_bits, sizeof(ff_aac_scalefactor_bits[0]), sizeof(ff_aac_scalefactor_bits[0]),
ff_aac_scalefactor_code, sizeof(ff_aac_scalefactor_code[0]), sizeof(ff_aac_scalefactor_code[0]),
INIT_VLC_STATIC(&vlc_scalefactors, 7,
FF_ARRAY_ELEMS(ff_aac_scalefactor_code),
ff_aac_scalefactor_bits,
sizeof(ff_aac_scalefactor_bits[0]),
sizeof(ff_aac_scalefactor_bits[0]),
ff_aac_scalefactor_code,
sizeof(ff_aac_scalefactor_code[0]),
sizeof(ff_aac_scalefactor_code[0]),
352);
ff_mdct_init(&ac->mdct, 11, 1, 1.0 / (32768.0 * 1024.0));
@ -972,7 +1046,7 @@ static int skip_data_stream_element(AACContext *ac, GetBitContext *gb)
if (get_bits_left(gb) < 8 * count) {
av_log(ac->avctx, AV_LOG_ERROR, "skip_data_stream_element: "overread_err);
return -1;
return AVERROR_INVALIDDATA;
}
skip_bits_long(gb, 8 * count);
return 0;
@ -984,9 +1058,11 @@ static int decode_prediction(AACContext *ac, IndividualChannelStream *ics,
int sfb;
if (get_bits1(gb)) {
ics->predictor_reset_group = get_bits(gb, 5);
if (ics->predictor_reset_group == 0 || ics->predictor_reset_group > 30) {
av_log(ac->avctx, AV_LOG_ERROR, "Invalid Predictor Reset Group.\n");
return -1;
if (ics->predictor_reset_group == 0 ||
ics->predictor_reset_group > 30) {
av_log(ac->avctx, AV_LOG_ERROR,
"Invalid Predictor Reset Group.\n");
return AVERROR_INVALIDDATA;
}
}
for (sfb = 0; sfb < FFMIN(ics->max_sfb, ff_aac_pred_sfb_max[ac->oc[1].m4ac.sampling_index]); sfb++) {
@ -1055,7 +1131,8 @@ static int decode_ics_info(AACContext *ac, IndividualChannelStream *ics,
goto fail;
}
} else if (ac->oc[1].m4ac.object_type == AOT_AAC_LC) {
av_log(ac->avctx, AV_LOG_ERROR, "Prediction is not allowed in AAC-LC.\n");
av_log(ac->avctx, AV_LOG_ERROR,
"Prediction is not allowed in AAC-LC.\n");
goto fail;
} else {
if ((ics->ltp.present = get_bits(gb, 1)))
@ -1066,7 +1143,8 @@ static int decode_ics_info(AACContext *ac, IndividualChannelStream *ics,
if (ics->max_sfb > ics->num_swb) {
av_log(ac->avctx, AV_LOG_ERROR,
"Number of scalefactor bands in group (%d) exceeds limit (%d).\n",
"Number of scalefactor bands in group (%d) "
"exceeds limit (%d).\n",
ics->max_sfb, ics->num_swb);
goto fail;
}
@ -1099,20 +1177,20 @@ static int decode_band_types(AACContext *ac, enum BandType band_type[120],
int sect_band_type = get_bits(gb, 4);
if (sect_band_type == 12) {
av_log(ac->avctx, AV_LOG_ERROR, "invalid band type\n");
return -1;
return AVERROR_INVALIDDATA;
}
do {
sect_len_incr = get_bits(gb, bits);
sect_end += sect_len_incr;
if (get_bits_left(gb) < 0) {
av_log(ac->avctx, AV_LOG_ERROR, "decode_band_types: "overread_err);
return -1;
return AVERROR_INVALIDDATA;
}
if (sect_end > ics->max_sfb) {
av_log(ac->avctx, AV_LOG_ERROR,
"Number of bands (%d) exceeds limit (%d).\n",
sect_end, ics->max_sfb);
return -1;
return AVERROR_INVALIDDATA;
}
} while (sect_len_incr == (1 << bits) - 1);
for (; k < sect_end; k++) {
@ -1150,7 +1228,8 @@ static int decode_scalefactors(AACContext *ac, float sf[120], GetBitContext *gb,
if (band_type[idx] == ZERO_BT) {
for (; i < run_end; i++, idx++)
sf[idx] = 0.;
} else if ((band_type[idx] == INTENSITY_BT) || (band_type[idx] == INTENSITY_BT2)) {
} else if ((band_type[idx] == INTENSITY_BT) ||
(band_type[idx] == INTENSITY_BT2)) {
for (; i < run_end; i++, idx++) {
offset[2] += get_vlc2(gb, vlc_scalefactors.table, 7, 3) - 60;
clipped_offset = av_clip(offset[2], -155, 100);
@ -1183,7 +1262,7 @@ static int decode_scalefactors(AACContext *ac, float sf[120], GetBitContext *gb,
if (offset[0] > 255U) {
av_log(ac->avctx, AV_LOG_ERROR,
"Scalefactor (%d) out of range.\n", offset[0]);
return -1;
return AVERROR_INVALIDDATA;
}
sf[idx] = -ff_aac_pow2sf_tab[offset[0] - 100 + POW_SF2_ZERO];
}
@ -1238,10 +1317,11 @@ static int decode_tns(AACContext *ac, TemporalNoiseShaping *tns,
tns->length[w][filt] = get_bits(gb, 6 - 2 * is8);
if ((tns->order[w][filt] = get_bits(gb, 5 - 2 * is8)) > tns_max_order) {
av_log(ac->avctx, AV_LOG_ERROR, "TNS filter order %d is greater than maximum %d.\n",
av_log(ac->avctx, AV_LOG_ERROR,
"TNS filter order %d is greater than maximum %d.\n",
tns->order[w][filt], tns_max_order);
tns->order[w][filt] = 0;
return -1;
return AVERROR_INVALIDDATA;
}
if (tns->order[w][filt]) {
tns->direction[w][filt] = get_bits1(gb);
@ -1270,7 +1350,9 @@ static void decode_mid_side_stereo(ChannelElement *cpe, GetBitContext *gb,
{
int idx;
if (ms_present == 1) {
for (idx = 0; idx < cpe->ch[0].ics.num_window_groups * cpe->ch[0].ics.max_sfb; idx++)
for (idx = 0;
idx < cpe->ch[0].ics.num_window_groups * cpe->ch[0].ics.max_sfb;
idx++)
cpe->ms_mask[idx] = get_bits1(gb);
} else if (ms_present == 2) {
memset(cpe->ms_mask, 1, sizeof(cpe->ms_mask[0]) * cpe->ch[0].ics.num_window_groups * cpe->ch[0].ics.max_sfb);
@ -1369,7 +1451,8 @@ static int decode_spectrum_and_dequant(AACContext *ac, float coef[1024],
float *coef_base = coef;
for (g = 0; g < ics->num_windows; g++)
memset(coef + g * 128 + offsets[ics->max_sfb], 0, sizeof(float) * (c - offsets[ics->max_sfb]));
memset(coef + g * 128 + offsets[ics->max_sfb], 0,
sizeof(float) * (c - offsets[ics->max_sfb]));
for (g = 0; g < ics->num_window_groups; g++) {
unsigned g_len = ics->group_len[g];
@ -1524,7 +1607,7 @@ static int decode_spectrum_and_dequant(AACContext *ac, float coef[1024],
if (b > 8) {
av_log(ac->avctx, AV_LOG_ERROR, "error in spectral data, ESC overflow\n");
return -1;
return AVERROR_INVALIDDATA;
}
SKIP_BITS(re, gb, b + 1);
@ -1639,14 +1722,20 @@ static void apply_prediction(AACContext *ac, SingleChannelElement *sce)
}
if (sce->ics.window_sequence[0] != EIGHT_SHORT_SEQUENCE) {
for (sfb = 0; sfb < ff_aac_pred_sfb_max[ac->oc[1].m4ac.sampling_index]; sfb++) {
for (k = sce->ics.swb_offset[sfb]; k < sce->ics.swb_offset[sfb + 1]; k++) {
for (sfb = 0;
sfb < ff_aac_pred_sfb_max[ac->oc[1].m4ac.sampling_index];
sfb++) {
for (k = sce->ics.swb_offset[sfb];
k < sce->ics.swb_offset[sfb + 1];
k++) {
predict(&sce->predictor_state[k], &sce->coeffs[k],
sce->ics.predictor_present && sce->ics.prediction_used[sfb]);
sce->ics.predictor_present &&
sce->ics.prediction_used[sfb]);
}
}
if (sce->ics.predictor_reset_group)
reset_predictor_group(sce->predictor_state, sce->ics.predictor_reset_group);
reset_predictor_group(sce->predictor_state,
sce->ics.predictor_reset_group);
} else
reset_all_predictors(sce->predictor_state);
}
@ -1667,6 +1756,7 @@ static int decode_ics(AACContext *ac, SingleChannelElement *sce,
IndividualChannelStream *ics = &sce->ics;
float *out = sce->coeffs;
int global_gain, pulse_present = 0;
int ret;
/* This assignment is to silence a GCC warning about the variable being used
* uninitialized when in fact it always is.
@ -1680,33 +1770,38 @@ static int decode_ics(AACContext *ac, SingleChannelElement *sce,
return AVERROR_INVALIDDATA;
}
if (decode_band_types(ac, sce->band_type, sce->band_type_run_end, gb, ics) < 0)
return -1;
if (decode_scalefactors(ac, sce->sf, gb, global_gain, ics, sce->band_type, sce->band_type_run_end) < 0)
return -1;
if ((ret = decode_band_types(ac, sce->band_type,
sce->band_type_run_end, gb, ics)) < 0)
return ret;
if ((ret = decode_scalefactors(ac, sce->sf, gb, global_gain, ics,
sce->band_type, sce->band_type_run_end)) < 0)
return ret;
pulse_present = 0;
if (!scale_flag) {
if ((pulse_present = get_bits1(gb))) {
if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
av_log(ac->avctx, AV_LOG_ERROR, "Pulse tool not allowed in eight short sequence.\n");
return -1;
av_log(ac->avctx, AV_LOG_ERROR,
"Pulse tool not allowed in eight short sequence.\n");
return AVERROR_INVALIDDATA;
}
if (decode_pulses(&pulse, gb, ics->swb_offset, ics->num_swb)) {
av_log(ac->avctx, AV_LOG_ERROR, "Pulse data corrupt or invalid.\n");
return -1;
av_log(ac->avctx, AV_LOG_ERROR,
"Pulse data corrupt or invalid.\n");
return AVERROR_INVALIDDATA;
}
}
if ((tns->present = get_bits1(gb)) && decode_tns(ac, tns, gb, ics))
return -1;
return AVERROR_INVALIDDATA;
if (get_bits1(gb)) {
av_log_missing_feature(ac->avctx, "SSR", 1);
return AVERROR_PATCHWELCOME;
}
}
if (decode_spectrum_and_dequant(ac, out, gb, sce->sf, pulse_present, &pulse, ics, sce->band_type) < 0)
return -1;
if (decode_spectrum_and_dequant(ac, out, gb, sce->sf, pulse_present,
&pulse, ics, sce->band_type) < 0)
return AVERROR_INVALIDDATA;
if (ac->oc[1].m4ac.object_type == AOT_AAC_MAIN && !common_window)
apply_prediction(ac, sce);
@ -1727,7 +1822,8 @@ static void apply_mid_side_stereo(AACContext *ac, ChannelElement *cpe)
for (g = 0; g < ics->num_window_groups; g++) {
for (i = 0; i < ics->max_sfb; i++, idx++) {
if (cpe->ms_mask[idx] &&
cpe->ch[0].band_type[idx] < NOISE_BT && cpe->ch[1].band_type[idx] < NOISE_BT) {
cpe->ch[0].band_type[idx] < NOISE_BT &&
cpe->ch[1].band_type[idx] < NOISE_BT) {
for (group = 0; group < ics->group_len[g]; group++) {
ac->dsp.butterflies_float(ch0 + group * 128 + offsets[i],
ch1 + group * 128 + offsets[i],
@ -1747,7 +1843,8 @@ static void apply_mid_side_stereo(AACContext *ac, ChannelElement *cpe)
* [1] mask is decoded from bitstream; [2] mask is all 1s;
* [3] reserved for scalable AAC
*/
static void apply_intensity_stereo(AACContext *ac, ChannelElement *cpe, int ms_present)
static void apply_intensity_stereo(AACContext *ac,
ChannelElement *cpe, int ms_present)
{
const IndividualChannelStream *ics = &cpe->ch[1].ics;
SingleChannelElement *sce1 = &cpe->ch[1];
@ -1758,7 +1855,8 @@ static void apply_intensity_stereo(AACContext *ac, ChannelElement *cpe, int ms_p
float scale;
for (g = 0; g < ics->num_window_groups; g++) {
for (i = 0; i < ics->max_sfb;) {
if (sce1->band_type[idx] == INTENSITY_BT || sce1->band_type[idx] == INTENSITY_BT2) {
if (sce1->band_type[idx] == INTENSITY_BT ||
sce1->band_type[idx] == INTENSITY_BT2) {
const int bt_run_end = sce1->band_type_run_end[idx];
for (; i < bt_run_end; i++, idx++) {
c = -1 + 2 * (sce1->band_type[idx] - 14);
@ -1798,13 +1896,14 @@ static int decode_cpe(AACContext *ac, GetBitContext *gb, ChannelElement *cpe)
i = cpe->ch[1].ics.use_kb_window[0];
cpe->ch[1].ics = cpe->ch[0].ics;
cpe->ch[1].ics.use_kb_window[1] = i;
if (cpe->ch[1].ics.predictor_present && (ac->oc[1].m4ac.object_type != AOT_AAC_MAIN))
if (cpe->ch[1].ics.predictor_present &&
(ac->oc[1].m4ac.object_type != AOT_AAC_MAIN))
if ((cpe->ch[1].ics.ltp.present = get_bits(gb, 1)))
decode_ltp(&cpe->ch[1].ics.ltp, gb, cpe->ch[1].ics.max_sfb);
ms_present = get_bits(gb, 2);
if (ms_present == 3) {
av_log(ac->avctx, AV_LOG_ERROR, "ms_present = 3 is reserved.\n");
return -1;
return AVERROR_INVALIDDATA;
} else if (ms_present)
decode_mid_side_stereo(cpe, gb, ms_present);
}
@ -2665,7 +2764,8 @@ static int aac_decode_frame(AVCodecContext *avctx, void *data,
if (ac->force_dmono_mode >= 0)
ac->dmono_mode = ac->force_dmono_mode;
init_get_bits(&gb, buf, buf_size * 8);
if ((err = init_get_bits(&gb, buf, buf_size * 8)) < 0)
return err;
if ((err = aac_decode_frame_int(avctx, data, got_frame_ptr, &gb, avpkt)) < 0)
return err;
@ -2701,13 +2801,13 @@ static av_cold int aac_decode_close(AVCodecContext *avctx)
#define LOAS_SYNC_WORD 0x2b7 ///< 11 bits LOAS sync word
struct LATMContext {
AACContext aac_ctx; ///< containing AACContext
int initialized; ///< initialized after a valid extradata was seen
AACContext aac_ctx; ///< containing AACContext
int initialized; ///< initilized after a valid extradata was seen
// parser data
int audio_mux_version_A; ///< LATM syntax version
int frame_length_type; ///< 0/1 variable/fixed frame length
int frame_length; ///< frame length for fixed frame length
int audio_mux_version_A; ///< LATM syntax version
int frame_length_type; ///< 0/1 variable/fixed frame length
int frame_length; ///< frame length for fixed frame length
};
static inline uint32_t latm_get_value(GetBitContext *b)
@ -2915,7 +3015,8 @@ static int latm_decode_frame(AVCodecContext *avctx, void *out,
int muxlength, err;
GetBitContext gb;
init_get_bits(&gb, avpkt->data, avpkt->size * 8);
if ((err = init_get_bits(&gb, avpkt->data, avpkt->size * 8)) < 0)
return err;
// check for LOAS sync word
if (get_bits(&gb, 11) != LOAS_SYNC_WORD)

View File

@ -166,7 +166,7 @@ static void put_audio_specific_config(AVCodecContext *avctx)
PutBitContext pb;
AACEncContext *s = avctx->priv_data;
init_put_bits(&pb, avctx->extradata, avctx->extradata_size*8);
init_put_bits(&pb, avctx->extradata, avctx->extradata_size);
put_bits(&pb, 5, 2); //object type - AAC-LC
put_bits(&pb, 4, s->samplerate_index); //sample rate index
put_bits(&pb, 4, s->channels);
@ -517,7 +517,7 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
/* add current frame to queue */
if (frame) {
if ((ret = ff_af_queue_add(&s->afq, frame) < 0))
if ((ret = ff_af_queue_add(&s->afq, frame)) < 0)
return ret;
}

View File

@ -1121,7 +1121,12 @@ static void sbr_dequant(SpectralBandReplication *sbr, int id_aac)
for (k = 0; k < sbr->n[sbr->data[0].bs_freq_res[e]]; k++) {
float temp1 = exp2f(sbr->data[0].env_facs[e][k] * alpha + 7.0f);
float temp2 = exp2f((pan_offset - sbr->data[1].env_facs[e][k]) * alpha);
float fac = temp1 / (1.0f + temp2);
float fac;
if (temp1 > 1E20) {
av_log(NULL, AV_LOG_ERROR, "envelope scalefactor overflow in dequant\n");
temp1 = 1;
}
fac = temp1 / (1.0f + temp2);
sbr->data[0].env_facs[e][k] = fac;
sbr->data[1].env_facs[e][k] = fac * temp2;
}
@ -1130,7 +1135,12 @@ static void sbr_dequant(SpectralBandReplication *sbr, int id_aac)
for (k = 0; k < sbr->n_q; k++) {
float temp1 = exp2f(NOISE_FLOOR_OFFSET - sbr->data[0].noise_facs[e][k] + 1);
float temp2 = exp2f(12 - sbr->data[1].noise_facs[e][k]);
float fac = temp1 / (1.0f + temp2);
float fac;
if (temp1 > 1E20) {
av_log(NULL, AV_LOG_ERROR, "envelope scalefactor overflow in dequant\n");
temp1 = 1;
}
fac = temp1 / (1.0f + temp2);
sbr->data[0].noise_facs[e][k] = fac;
sbr->data[1].noise_facs[e][k] = fac * temp2;
}
@ -1139,9 +1149,15 @@ static void sbr_dequant(SpectralBandReplication *sbr, int id_aac)
for (ch = 0; ch < (id_aac == TYPE_CPE) + 1; ch++) {
float alpha = sbr->data[ch].bs_amp_res ? 1.0f : 0.5f;
for (e = 1; e <= sbr->data[ch].bs_num_env; e++)
for (k = 0; k < sbr->n[sbr->data[ch].bs_freq_res[e]]; k++)
for (k = 0; k < sbr->n[sbr->data[ch].bs_freq_res[e]]; k++){
sbr->data[ch].env_facs[e][k] =
exp2f(alpha * sbr->data[ch].env_facs[e][k] + 6.0f);
if (sbr->data[ch].env_facs[e][k] > 1E20) {
av_log(NULL, AV_LOG_ERROR, "envelope scalefactor overflow in dequant\n");
sbr->data[ch].env_facs[e][k] = 1;
}
}
for (e = 1; e <= sbr->data[ch].bs_num_noise; e++)
for (k = 0; k < sbr->n_q; k++)
sbr->data[ch].noise_facs[e][k] =

View File

@ -60,7 +60,7 @@ static av_cold int aasc_decode_init(AVCodecContext *avctx)
}
break;
case 16:
avctx->pix_fmt = AV_PIX_FMT_RGB555;
avctx->pix_fmt = AV_PIX_FMT_RGB555LE;
break;
case 24:
avctx->pix_fmt = AV_PIX_FMT_BGR24;

View File

@ -147,7 +147,7 @@ static int ac3_sync(uint64_t state, AACAC3ParseContext *hdr_info,
int err;
union {
uint64_t u64;
uint8_t u8[8];
uint8_t u8[8 + FF_INPUT_BUFFER_PADDING_SIZE];
} tmp = { av_be2ne64(state) };
AC3HeaderInfo hdr;
GetBitContext gbc;

View File

@ -292,7 +292,7 @@ static int parse_frame_header(AC3DecodeContext *s)
return ff_eac3_parse_header(s);
} else {
av_log(s->avctx, AV_LOG_ERROR, "E-AC-3 support not compiled in\n");
return -1;
return AVERROR(ENOSYS);
}
}
@ -787,12 +787,12 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
if (start_subband >= end_subband) {
av_log(s->avctx, AV_LOG_ERROR, "invalid spectral extension "
"range (%d >= %d)\n", start_subband, end_subband);
return -1;
return AVERROR_INVALIDDATA;
}
if (dst_start_freq >= src_start_freq) {
av_log(s->avctx, AV_LOG_ERROR, "invalid spectral extension "
"copy start bin (%d >= %d)\n", dst_start_freq, src_start_freq);
return -1;
return AVERROR_INVALIDDATA;
}
s->spx_dst_start_freq = dst_start_freq;
@ -869,7 +869,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
if (channel_mode < AC3_CHMODE_STEREO) {
av_log(s->avctx, AV_LOG_ERROR, "coupling not allowed in mono or dual-mono\n");
return -1;
return AVERROR_INVALIDDATA;
}
/* check for enhanced coupling */
@ -899,7 +899,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
if (cpl_start_subband >= cpl_end_subband) {
av_log(s->avctx, AV_LOG_ERROR, "invalid coupling range (%d >= %d)\n",
cpl_start_subband, cpl_end_subband);
return -1;
return AVERROR_INVALIDDATA;
}
s->start_freq[CPL_CH] = cpl_start_subband * 12 + 37;
s->end_freq[CPL_CH] = cpl_end_subband * 12 + 37;
@ -921,7 +921,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
if (!blk) {
av_log(s->avctx, AV_LOG_ERROR, "new coupling strategy must "
"be present in block 0\n");
return -1;
return AVERROR_INVALIDDATA;
} else {
s->cpl_in_use[blk] = s->cpl_in_use[blk-1];
}
@ -951,7 +951,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
} else if (!blk) {
av_log(s->avctx, AV_LOG_ERROR, "new coupling coordinates must "
"be present in block 0\n");
return -1;
return AVERROR_INVALIDDATA;
}
} else {
/* channel not in coupling */
@ -1006,7 +1006,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
int bandwidth_code = get_bits(gbc, 6);
if (bandwidth_code > 60) {
av_log(s->avctx, AV_LOG_ERROR, "bandwidth code = %d > 60\n", bandwidth_code);
return -1;
return AVERROR_INVALIDDATA;
}
s->end_freq[ch] = bandwidth_code * 3 + 73;
}
@ -1029,7 +1029,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
s->num_exp_groups[ch], s->dexps[ch][0],
&s->dexps[ch][s->start_freq[ch]+!!ch])) {
av_log(s->avctx, AV_LOG_ERROR, "exponent out-of-range\n");
return -1;
return AVERROR_INVALIDDATA;
}
if (ch != CPL_CH && ch != s->lfe_ch)
skip_bits(gbc, 2); /* skip gainrng */
@ -1049,7 +1049,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
} else if (!blk) {
av_log(s->avctx, AV_LOG_ERROR, "new bit allocation info must "
"be present in block 0\n");
return -1;
return AVERROR_INVALIDDATA;
}
}
@ -1080,7 +1080,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
}
} else if (!s->eac3 && !blk) {
av_log(s->avctx, AV_LOG_ERROR, "new snr offsets must be present in block 0\n");
return -1;
return AVERROR_INVALIDDATA;
}
}
@ -1119,7 +1119,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
} else if (!s->eac3 && !blk) {
av_log(s->avctx, AV_LOG_ERROR, "new coupling leak info must "
"be present in block 0\n");
return -1;
return AVERROR_INVALIDDATA;
}
s->first_cpl_leak = 0;
}
@ -1131,7 +1131,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
s->dba_mode[ch] = get_bits(gbc, 2);
if (s->dba_mode[ch] == DBA_RESERVED) {
av_log(s->avctx, AV_LOG_ERROR, "delta bit allocation strategy reserved\n");
return -1;
return AVERROR_INVALIDDATA;
}
bit_alloc_stages[ch] = FFMAX(bit_alloc_stages[ch], 2);
}
@ -1172,7 +1172,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
s->dba_offsets[ch], s->dba_lengths[ch],
s->dba_values[ch], s->mask[ch])) {
av_log(s->avctx, AV_LOG_ERROR, "error in bit allocation\n");
return -1;
return AVERROR_INVALIDDATA;
}
}
if (bit_alloc_stages[ch] > 0) {
@ -1291,7 +1291,7 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data,
switch (err) {
case AAC_AC3_PARSE_ERROR_SYNC:
av_log(avctx, AV_LOG_ERROR, "frame sync error\n");
return -1;
return AVERROR_INVALIDDATA;
case AAC_AC3_PARSE_ERROR_BSID:
av_log(avctx, AV_LOG_ERROR, "invalid bitstream id\n");
break;
@ -1305,17 +1305,20 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data,
/* skip frame if CRC is ok. otherwise use error concealment. */
/* TODO: add support for substreams and dependent frames */
if (s->frame_type == EAC3_FRAME_TYPE_DEPENDENT || s->substreamid) {
av_log(avctx, AV_LOG_ERROR, "unsupported frame type : "
av_log(avctx, AV_LOG_WARNING, "unsupported frame type : "
"skipping frame\n");
*got_frame_ptr = 0;
return s->frame_size;
return buf_size;
} else {
av_log(avctx, AV_LOG_ERROR, "invalid frame type\n");
}
break;
default:
av_log(avctx, AV_LOG_ERROR, "invalid header\n");
case AAC_AC3_PARSE_ERROR_CRC:
case AAC_AC3_PARSE_ERROR_CHANNEL_CFG:
break;
default: // Normal AVERROR do not try to recover.
*got_frame_ptr = 0;
return err;
}
} else {
/* check that reported frame size fits in input buffer */
@ -1336,8 +1339,10 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data,
if (!err) {
avctx->sample_rate = s->sample_rate;
avctx->bit_rate = s->bit_rate;
}
/* channel config */
/* channel config */
if (!err || (s->channels && s->out_channels != s->channels)) {
s->out_channels = s->channels;
s->output_mode = s->channel_mode;
if (s->lfe_on)
@ -1360,22 +1365,18 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data,
s->fbw_channels == s->out_channels)) {
set_downmix_coeffs(s);
}
} else if (!s->out_channels) {
s->out_channels = avctx->channels;
if (s->out_channels < s->channels)
s->output_mode = s->out_channels == 1 ? AC3_CHMODE_MONO : AC3_CHMODE_STEREO;
}
if (avctx->channels != s->out_channels) {
av_log(avctx, AV_LOG_ERROR, "channel number mismatching on damaged frame\n");
} else if (!s->channels) {
av_log(avctx, AV_LOG_ERROR, "unable to determine channel mode\n");
return AVERROR_INVALIDDATA;
}
avctx->channels = s->out_channels;
/* set audio service type based on bitstream mode for AC-3 */
avctx->audio_service_type = s->bitstream_mode;
if (s->bitstream_mode == 0x7 && s->channels > 1)
avctx->audio_service_type = AV_AUDIO_SERVICE_TYPE_KARAOKE;
/* get output buffer */
avctx->channels = s->out_channels;
s->frame.nb_samples = s->num_blocks * 256;
if ((ret = ff_get_buffer(avctx, &s->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");

View File

@ -259,7 +259,7 @@ static void apply_channel_coupling(AC3EncodeContext *s)
energy_cpl = energy[blk][CPL_CH][bnd];
energy_ch = energy[blk][ch][bnd];
blk1 = blk+1;
while (!s->blocks[blk1].new_cpl_coords[ch] && blk1 < s->num_blocks) {
while (blk1 < s->num_blocks && !s->blocks[blk1].new_cpl_coords[ch]) {
if (s->blocks[blk1].cpl_in_use) {
energy_cpl += energy[blk1][CPL_CH][bnd];
energy_ch += energy[blk1][ch][bnd];

View File

@ -1387,7 +1387,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
static const enum AVSampleFormat sample_fmts_s16[] = { AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_NONE };
static const enum AVSampleFormat sample_fmts_s16p[] = { AV_SAMPLE_FMT_S16,
static const enum AVSampleFormat sample_fmts_s16p[] = { AV_SAMPLE_FMT_S16P,
AV_SAMPLE_FMT_NONE };
static const enum AVSampleFormat sample_fmts_both[] = { AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_S16P,

View File

@ -550,7 +550,7 @@ static int adpcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
case AV_CODEC_ID_ADPCM_IMA_QT:
{
PutBitContext pb;
init_put_bits(&pb, dst, pkt_size * 8);
init_put_bits(&pb, dst, pkt_size);
for (ch = 0; ch < avctx->channels; ch++) {
ADPCMChannelStatus *status = &c->status[ch];
@ -558,10 +558,11 @@ static int adpcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
put_bits(&pb, 7, status->step_index);
if (avctx->trellis > 0) {
uint8_t buf[64];
adpcm_compress_trellis(avctx, &samples_p[ch][1], buf, status,
adpcm_compress_trellis(avctx, &samples_p[ch][0], buf, status,
64, 1);
for (i = 0; i < 64; i++)
put_bits(&pb, 4, buf[i ^ 1]);
status->prev_sample = status->predictor;
} else {
for (i = 0; i < 64; i += 2) {
int t1, t2;
@ -579,7 +580,7 @@ static int adpcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
case AV_CODEC_ID_ADPCM_SWF:
{
PutBitContext pb;
init_put_bits(&pb, dst, pkt_size * 8);
init_put_bits(&pb, dst, pkt_size);
n = frame->nb_samples - 1;

View File

@ -47,13 +47,8 @@ int avpriv_adx_decode_header(AVCodecContext *avctx, const uint8_t *buf,
return AVERROR_INVALIDDATA;
offset = AV_RB16(buf + 2) + 4;
if (offset < 6) {
av_log(avctx, AV_LOG_ERROR, "offset is prior data\n");
return AVERROR_INVALIDDATA;
}
/* if copyright string is within the provided data, validate it */
if (bufsize >= offset && memcmp(buf + offset - 6, "(c)CRI", 6))
if (bufsize >= offset && offset >= 6 && memcmp(buf + offset - 6, "(c)CRI", 6))
return AVERROR_INVALIDDATA;
/* check for encoding=3 block_size=18, sample_size=4 */

View File

@ -321,6 +321,9 @@ static int decode_element(AVCodecContext *avctx, void *data, int ch_index,
rice_history_mult[ch] = get_bits(&alac->gb, 3);
lpc_order[ch] = get_bits(&alac->gb, 5);
if (lpc_order[ch] >= alac->max_samples_per_frame)
return AVERROR_INVALIDDATA;
/* read the predictor table */
for (i = lpc_order[ch] - 1; i >= 0; i--)
lpc_coefs[ch][i] = get_sbits(&alac->gb, 16);
@ -462,9 +465,8 @@ static int alac_decode_frame(AVCodecContext *avctx, void *data,
}
channels = (element == TYPE_CPE) ? 2 : 1;
if ( ch + channels > alac->channels
|| ff_alac_channel_layout_offsets[alac->channels - 1][ch] + channels > alac->channels
) {
if (ch + channels > alac->channels ||
ff_alac_channel_layout_offsets[alac->channels - 1][ch] + channels > alac->channels) {
av_log(avctx, AV_LOG_ERROR, "invalid element channel count\n");
return AVERROR_INVALIDDATA;
}
@ -546,7 +548,8 @@ static int alac_set_info(ALACContext *alac)
bytestream2_skipu(&gb, 12); // size:4, alac:4, version:4
alac->max_samples_per_frame = bytestream2_get_be32u(&gb);
if (!alac->max_samples_per_frame || alac->max_samples_per_frame > INT_MAX) {
if (!alac->max_samples_per_frame ||
alac->max_samples_per_frame > INT_MAX / sizeof(int32_t)) {
av_log(alac->avctx, AV_LOG_ERROR, "max samples per frame invalid: %u\n",
alac->max_samples_per_frame);
return AVERROR_INVALIDDATA;

View File

@ -67,7 +67,7 @@ typedef struct AlacEncodeContext {
int write_sample_size;
int extra_bits;
int32_t sample_buf[2][DEFAULT_FRAME_SIZE];
int32_t predictor_buf[DEFAULT_FRAME_SIZE];
int32_t predictor_buf[2][DEFAULT_FRAME_SIZE];
int interlacing_shift;
int interlacing_leftweight;
PutBitContext pbctx;
@ -254,13 +254,14 @@ static void alac_linear_predictor(AlacEncodeContext *s, int ch)
{
int i;
AlacLPCContext lpc = s->lpc[ch];
int32_t *residual = s->predictor_buf[ch];
if (lpc.lpc_order == 31) {
s->predictor_buf[0] = s->sample_buf[ch][0];
residual[0] = s->sample_buf[ch][0];
for (i = 1; i < s->frame_size; i++) {
s->predictor_buf[i] = s->sample_buf[ch][i ] -
s->sample_buf[ch][i - 1];
residual[i] = s->sample_buf[ch][i ] -
s->sample_buf[ch][i - 1];
}
return;
@ -270,12 +271,11 @@ static void alac_linear_predictor(AlacEncodeContext *s, int ch)
if (lpc.lpc_order > 0) {
int32_t *samples = s->sample_buf[ch];
int32_t *residual = s->predictor_buf;
// generate warm-up samples
residual[0] = samples[0];
for (i = 1; i <= lpc.lpc_order; i++)
residual[i] = samples[i] - samples[i-1];
residual[i] = sign_extend(samples[i] - samples[i-1], s->write_sample_size);
// perform lpc on remaining samples
for (i = lpc.lpc_order + 1; i < s->frame_size; i++) {
@ -314,11 +314,11 @@ static void alac_linear_predictor(AlacEncodeContext *s, int ch)
}
}
static void alac_entropy_coder(AlacEncodeContext *s)
static void alac_entropy_coder(AlacEncodeContext *s, int ch)
{
unsigned int history = s->rc.initial_history;
int sign_modifier = 0, i, k;
int32_t *samples = s->predictor_buf;
int32_t *samples = s->predictor_buf[ch];
for (i = 0; i < s->frame_size;) {
int x;
@ -395,6 +395,19 @@ static void write_element(AlacEncodeContext *s,
init_sample_buffers(s, channels, samples);
write_element_header(s, element, instance);
// extract extra bits if needed
if (s->extra_bits) {
uint32_t mask = (1 << s->extra_bits) - 1;
for (j = 0; j < channels; j++) {
int32_t *extra = s->predictor_buf[j];
int32_t *smp = s->sample_buf[j];
for (i = 0; i < s->frame_size; i++) {
extra[i] = smp[i] & mask;
smp[i] >>= s->extra_bits;
}
}
}
if (channels == 2)
alac_stereo_decorrelation(s);
else
@ -420,8 +433,7 @@ static void write_element(AlacEncodeContext *s,
uint32_t mask = (1 << s->extra_bits) - 1;
for (i = 0; i < s->frame_size; i++) {
for (j = 0; j < channels; j++) {
put_bits(pb, s->extra_bits, s->sample_buf[j][i] & mask);
s->sample_buf[j][i] >>= s->extra_bits;
put_bits(pb, s->extra_bits, s->predictor_buf[j][i] & mask);
}
}
}
@ -433,10 +445,11 @@ static void write_element(AlacEncodeContext *s,
// TODO: determine when this will actually help. for now it's not used.
if (prediction_type == 15) {
// 2nd pass 1st order filter
int32_t *residual = s->predictor_buf[channels];
for (j = s->frame_size - 1; j > 0; j--)
s->predictor_buf[j] -= s->predictor_buf[j - 1];
residual[j] -= residual[j - 1];
}
alac_entropy_coder(s);
alac_entropy_coder(s, i);
}
}
}

View File

@ -285,7 +285,7 @@ static av_cold int read_specific_config(ALSDecContext *ctx)
GetBitContext gb;
uint64_t ht_size;
int i, config_offset;
MPEG4AudioConfig m4ac;
MPEG4AudioConfig m4ac = {0};
ALSSpecificConfig *sconf = &ctx->sconf;
AVCodecContext *avctx = ctx->avctx;
uint32_t als_id, header_size, trailer_size;
@ -296,12 +296,12 @@ static av_cold int read_specific_config(ALSDecContext *ctx)
avctx->extradata_size * 8, 1);
if (config_offset < 0)
return -1;
return AVERROR_INVALIDDATA;
skip_bits_long(&gb, config_offset);
if (get_bits_left(&gb) < (30 << 3))
return -1;
return AVERROR_INVALIDDATA;
// read the fixed items
als_id = get_bits_long(&gb, 32);
@ -336,7 +336,7 @@ static av_cold int read_specific_config(ALSDecContext *ctx)
// check for ALSSpecificConfig struct
if (als_id != MKBETAG('A','L','S','\0'))
return -1;
return AVERROR_INVALIDDATA;
ctx->cur_frame_length = sconf->frame_length;
@ -351,7 +351,7 @@ static av_cold int read_specific_config(ALSDecContext *ctx)
int chan_pos_bits = av_ceil_log2(avctx->channels);
int bits_needed = avctx->channels * chan_pos_bits + 7;
if (get_bits_left(&gb) < bits_needed)
return -1;
return AVERROR_INVALIDDATA;
if (!(sconf->chan_pos = av_malloc(avctx->channels * sizeof(*sconf->chan_pos))))
return AVERROR(ENOMEM);
@ -377,7 +377,7 @@ static av_cold int read_specific_config(ALSDecContext *ctx)
// read fixed header and trailer sizes,
// if size = 0xFFFFFFFF then there is no data field!
if (get_bits_left(&gb) < 64)
return -1;
return AVERROR_INVALIDDATA;
header_size = get_bits_long(&gb, 32);
trailer_size = get_bits_long(&gb, 32);
@ -391,10 +391,10 @@ static av_cold int read_specific_config(ALSDecContext *ctx)
// skip the header and trailer data
if (get_bits_left(&gb) < ht_size)
return -1;
return AVERROR_INVALIDDATA;
if (ht_size > INT32_MAX)
return -1;
return AVERROR_PATCHWELCOME;
skip_bits_long(&gb, ht_size);
@ -402,7 +402,7 @@ static av_cold int read_specific_config(ALSDecContext *ctx)
// initialize CRC calculation
if (sconf->crc_enabled) {
if (get_bits_left(&gb) < 32)
return -1;
return AVERROR_INVALIDDATA;
if (avctx->err_recognition & (AV_EF_CRCCHECK|AV_EF_CAREFUL)) {
ctx->crc_table = av_crc_get_table(AV_CRC_32_IEEE_LE);
@ -646,7 +646,7 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
if (bd->block_length & (sub_blocks - 1)) {
av_log(avctx, AV_LOG_WARNING,
"Block length is not evenly divisible by the number of subblocks.\n");
return -1;
return AVERROR_INVALIDDATA;
}
sb_length = bd->block_length >> log2_sub_blocks;
@ -983,14 +983,13 @@ static int read_block(ALSDecContext *ctx, ALSBlockData *bd)
*bd->shift_lsbs = 0;
// read block type flag and read the samples accordingly
if (get_bits1(gb)) {
if ((ret = read_var_block_data(ctx, bd)) < 0)
return ret;
ret = read_var_block_data(ctx, bd);
} else {
if ((ret = read_const_block_data(ctx, bd)) < 0)
return ret;
}
return 0;
return ret;
}
@ -999,12 +998,16 @@ static int read_block(ALSDecContext *ctx, ALSBlockData *bd)
static int decode_block(ALSDecContext *ctx, ALSBlockData *bd)
{
unsigned int smp;
int ret = 0;
// read block type flag and read the samples accordingly
if (*bd->const_block)
decode_const_block_data(ctx, bd);
else if (decode_var_block_data(ctx, bd))
return -1;
else
ret = decode_var_block_data(ctx, bd); // always return 0
if (ret < 0)
return ret;
// TODO: read RLSLMS extension data
@ -1022,14 +1025,10 @@ static int read_decode_block(ALSDecContext *ctx, ALSBlockData *bd)
{
int ret;
ret = read_block(ctx, bd);
if (ret)
if ((ret = read_block(ctx, bd)) < 0)
return ret;
ret = decode_block(ctx, bd);
return ret;
return decode_block(ctx, bd);
}
@ -1055,6 +1054,7 @@ static int decode_blocks_ind(ALSDecContext *ctx, unsigned int ra_frame,
unsigned int c, const unsigned int *div_blocks,
unsigned int *js_blocks)
{
int ret;
unsigned int b;
ALSBlockData bd = { 0 };
@ -1075,10 +1075,10 @@ static int decode_blocks_ind(ALSDecContext *ctx, unsigned int ra_frame,
for (b = 0; b < ctx->num_blocks; b++) {
bd.block_length = div_blocks[b];
if (read_decode_block(ctx, &bd)) {
if ((ret = read_decode_block(ctx, &bd)) < 0) {
// damaged block, write zero for the rest of the frame
zero_remaining(b, ctx->num_blocks, div_blocks, bd.raw_samples);
return -1;
return ret;
}
bd.raw_samples += div_blocks[b];
bd.ra_block = 0;
@ -1097,6 +1097,7 @@ static int decode_blocks(ALSDecContext *ctx, unsigned int ra_frame,
ALSSpecificConfig *sconf = &ctx->sconf;
unsigned int offset = 0;
unsigned int b;
int ret;
ALSBlockData bd[2] = { { 0 } };
bd[0].ra_block = ra_frame;
@ -1138,12 +1139,9 @@ static int decode_blocks(ALSDecContext *ctx, unsigned int ra_frame,
bd[0].raw_other = bd[1].raw_samples;
bd[1].raw_other = bd[0].raw_samples;
if(read_decode_block(ctx, &bd[0]) || read_decode_block(ctx, &bd[1])) {
// damaged block, write zero for the rest of the frame
zero_remaining(b, ctx->num_blocks, div_blocks, bd[0].raw_samples);
zero_remaining(b, ctx->num_blocks, div_blocks, bd[1].raw_samples);
return -1;
}
if ((ret = read_decode_block(ctx, &bd[0])) < 0 ||
(ret = read_decode_block(ctx, &bd[1])) < 0)
goto fail;
// reconstruct joint-stereo blocks
if (bd[0].js_blocks) {
@ -1169,8 +1167,19 @@ static int decode_blocks(ALSDecContext *ctx, unsigned int ra_frame,
sizeof(*ctx->raw_samples[c]) * sconf->max_order);
return 0;
fail:
// damaged block, write zero for the rest of the frame
zero_remaining(b, ctx->num_blocks, div_blocks, bd[0].raw_samples);
zero_remaining(b, ctx->num_blocks, div_blocks, bd[1].raw_samples);
return ret;
}
static inline int als_weighting(GetBitContext *gb, int k, int off)
{
int idx = av_clip(decode_rice(gb, k) + off,
0, FF_ARRAY_ELEMS(mcc_weightings) - 1);
return mcc_weightings[idx];
}
/** Read the channel data.
*/
@ -1186,19 +1195,19 @@ static int read_channel_data(ALSDecContext *ctx, ALSChannelData *cd, int c)
if (current->master_channel >= channels) {
av_log(ctx->avctx, AV_LOG_ERROR, "Invalid master channel.\n");
return -1;
return AVERROR_INVALIDDATA;
}
if (current->master_channel != c) {
current->time_diff_flag = get_bits1(gb);
current->weighting[0] = mcc_weightings[av_clip(decode_rice(gb, 1) + 16, 0, 31)];
current->weighting[1] = mcc_weightings[av_clip(decode_rice(gb, 2) + 14, 0, 31)];
current->weighting[2] = mcc_weightings[av_clip(decode_rice(gb, 1) + 16, 0, 31)];
current->weighting[0] = als_weighting(gb, 1, 16);
current->weighting[1] = als_weighting(gb, 2, 14);
current->weighting[2] = als_weighting(gb, 1, 16);
if (current->time_diff_flag) {
current->weighting[3] = mcc_weightings[av_clip(decode_rice(gb, 1) + 16, 0, 31)];
current->weighting[4] = mcc_weightings[av_clip(decode_rice(gb, 1) + 16, 0, 31)];
current->weighting[5] = mcc_weightings[av_clip(decode_rice(gb, 1) + 16, 0, 31)];
current->weighting[3] = als_weighting(gb, 1, 16);
current->weighting[4] = als_weighting(gb, 1, 16);
current->weighting[5] = als_weighting(gb, 1, 16);
current->time_diff_sign = get_bits1(gb);
current->time_diff_index = get_bits(gb, ctx->ltp_lag_length - 3) + 3;
@ -1211,7 +1220,7 @@ static int read_channel_data(ALSDecContext *ctx, ALSChannelData *cd, int c)
if (entries == channels) {
av_log(ctx->avctx, AV_LOG_ERROR, "Damaged channel data.\n");
return -1;
return AVERROR_INVALIDDATA;
}
align_get_bits(gb);
@ -1243,7 +1252,7 @@ static int revert_channel_correlation(ALSDecContext *ctx, ALSBlockData *bd,
if (dep == channels) {
av_log(ctx->avctx, AV_LOG_WARNING, "Invalid channel correlation.\n");
return -1;
return AVERROR_INVALIDDATA;
}
bd->const_block = ctx->const_block + c;
@ -1314,8 +1323,8 @@ static int read_frame_data(ALSDecContext *ctx, unsigned int ra_frame)
unsigned int div_blocks[32]; ///< block sizes.
unsigned int c;
unsigned int js_blocks[2];
uint32_t bs_info = 0;
int ret;
// skip the size of the ra unit if present in the frame
if (sconf->ra_flag == RA_FLAG_FRAMES && ra_frame)
@ -1346,13 +1355,15 @@ static int read_frame_data(ALSDecContext *ctx, unsigned int ra_frame)
independent_bs = 1;
if (independent_bs) {
if (decode_blocks_ind(ctx, ra_frame, c, div_blocks, js_blocks))
return -1;
ret = decode_blocks_ind(ctx, ra_frame, c,
div_blocks, js_blocks);
if (ret < 0)
return ret;
independent_bs--;
} else {
if (decode_blocks(ctx, ra_frame, c, div_blocks, js_blocks))
return -1;
ret = decode_blocks(ctx, ra_frame, c, div_blocks, js_blocks);
if (ret < 0)
return ret;
c++;
}
@ -1371,7 +1382,7 @@ static int read_frame_data(ALSDecContext *ctx, unsigned int ra_frame)
for (c = 0; c < avctx->channels; c++)
if (ctx->chan_data[c] < ctx->chan_data_buffer) {
av_log(ctx->avctx, AV_LOG_ERROR, "Invalid channel data.\n");
return -1;
return AVERROR_INVALIDDATA;
}
memset(reverted_channels, 0, sizeof(*reverted_channels) * avctx->channels);
@ -1383,6 +1394,11 @@ static int read_frame_data(ALSDecContext *ctx, unsigned int ra_frame)
for (b = 0; b < ctx->num_blocks; b++) {
bd.block_length = div_blocks[b];
if (bd.block_length <= 0) {
av_log(ctx->avctx, AV_LOG_WARNING,
"Invalid block length %d in channel data!\n", bd.block_length);
continue;
}
for (c = 0; c < avctx->channels; c++) {
bd.const_block = ctx->const_block + c;
@ -1403,11 +1419,12 @@ static int read_frame_data(ALSDecContext *ctx, unsigned int ra_frame)
return ret;
}
for (c = 0; c < avctx->channels; c++)
if (revert_channel_correlation(ctx, &bd, ctx->chan_data,
reverted_channels, offset, c))
return -1;
for (c = 0; c < avctx->channels; c++) {
ret = revert_channel_correlation(ctx, &bd, ctx->chan_data,
reverted_channels, offset, c);
if (ret < 0)
return ret;
}
for (c = 0; c < avctx->channels; c++) {
bd.const_block = ctx->const_block + c;
bd.shift_lsbs = ctx->shift_lsbs + c;
@ -1612,30 +1629,30 @@ static av_cold int decode_init(AVCodecContext *avctx)
{
unsigned int c;
unsigned int channel_size;
int num_buffers;
int num_buffers, ret;
ALSDecContext *ctx = avctx->priv_data;
ALSSpecificConfig *sconf = &ctx->sconf;
ctx->avctx = avctx;
if (!avctx->extradata) {
av_log(avctx, AV_LOG_ERROR, "Missing required ALS extradata.\n");
return -1;
return AVERROR_INVALIDDATA;
}
if (read_specific_config(ctx)) {
if ((ret = read_specific_config(ctx)) < 0) {
av_log(avctx, AV_LOG_ERROR, "Reading ALSSpecificConfig failed.\n");
decode_end(avctx);
return -1;
goto fail;
}
if (check_specific_config(ctx)) {
decode_end(avctx);
return -1;
if ((ret = check_specific_config(ctx)) < 0) {
goto fail;
}
if (sconf->bgmc)
ff_bgmc_init(avctx, &ctx->bgmc_lut, &ctx->bgmc_lut_status);
if (sconf->bgmc) {
ret = ff_bgmc_init(avctx, &ctx->bgmc_lut, &ctx->bgmc_lut_status);
if (ret < 0)
goto fail;
}
if (sconf->floating) {
avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
avctx->bits_per_raw_sample = 32;
@ -1670,7 +1687,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
!ctx->quant_cof_buffer || !ctx->lpc_cof_buffer ||
!ctx->lpc_cof_reversed_buffer) {
av_log(avctx, AV_LOG_ERROR, "Allocating buffer memory failed.\n");
return AVERROR(ENOMEM);
ret = AVERROR(ENOMEM);
goto fail;
}
// assign quantized parcor coefficient buffers
@ -1695,8 +1713,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
!ctx->use_ltp || !ctx->ltp_lag ||
!ctx->ltp_gain || !ctx->ltp_gain_buffer) {
av_log(avctx, AV_LOG_ERROR, "Allocating buffer memory failed.\n");
decode_end(avctx);
return AVERROR(ENOMEM);
ret = AVERROR(ENOMEM);
goto fail;
}
for (c = 0; c < num_buffers; c++)
@ -1713,8 +1731,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
if (!ctx->chan_data_buffer || !ctx->chan_data || !ctx->reverted_channels) {
av_log(avctx, AV_LOG_ERROR, "Allocating buffer memory failed.\n");
decode_end(avctx);
return AVERROR(ENOMEM);
ret = AVERROR(ENOMEM);
goto fail;
}
for (c = 0; c < num_buffers; c++)
@ -1734,8 +1752,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
// allocate previous raw sample buffer
if (!ctx->prev_raw_samples || !ctx->raw_buffer|| !ctx->raw_samples) {
av_log(avctx, AV_LOG_ERROR, "Allocating buffer memory failed.\n");
decode_end(avctx);
return AVERROR(ENOMEM);
ret = AVERROR(ENOMEM);
goto fail;
}
// assign raw samples buffers
@ -1752,8 +1770,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
av_get_bytes_per_sample(avctx->sample_fmt));
if (!ctx->crc_buffer) {
av_log(avctx, AV_LOG_ERROR, "Allocating buffer memory failed.\n");
decode_end(avctx);
return AVERROR(ENOMEM);
ret = AVERROR(ENOMEM);
goto fail;
}
}
@ -1763,6 +1781,10 @@ static av_cold int decode_init(AVCodecContext *avctx)
avctx->coded_frame = &ctx->frame;
return 0;
fail:
decode_end(avctx);
return ret;
}

View File

@ -415,7 +415,7 @@ static int decode_frame(AVCodecContext *avctx,
switch(buf[0]) {
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
if (s->nb_args < MAX_NB_ARGS)
if (s->nb_args < MAX_NB_ARGS && s->args[s->nb_args] < 6553)
s->args[s->nb_args] = FFMAX(s->args[s->nb_args], 0) * 10 + buf[0] - '0';
break;
case ';':

View File

@ -144,10 +144,11 @@ function ff_put_pixels8_y2_armv6, export=1
eor r7, r5, r7
uadd8 r10, r10, r6
and r7, r7, r12
ldr_pre r6, r1, r2
ldrc_pre ne, r6, r1, r2
uadd8 r11, r11, r7
strd_post r8, r9, r0, r2
ldr r7, [r1, #4]
it ne
ldrne r7, [r1, #4]
strd_post r10, r11, r0, r2
bne 1b
@ -196,9 +197,10 @@ function ff_put_pixels8_y2_no_rnd_armv6, export=1
uhadd8 r9, r5, r7
ldr r5, [r1, #4]
uhadd8 r12, r4, r6
ldr_pre r6, r1, r2
ldrc_pre ne, r6, r1, r2
uhadd8 r14, r5, r7
ldr r7, [r1, #4]
it ne
ldrne r7, [r1, #4]
stm r0, {r8,r9}
add r0, r0, r2
stm r0, {r12,r14}

View File

@ -91,7 +91,7 @@ static void ff_h264dsp_init_neon(H264DSPContext *c, const int bit_depth, const i
c->h264_idct_dc_add = ff_h264_idct_dc_add_neon;
c->h264_idct_add16 = ff_h264_idct_add16_neon;
c->h264_idct_add16intra = ff_h264_idct_add16intra_neon;
if (chroma_format_idc == 1)
if (chroma_format_idc <= 1)
c->h264_idct_add8 = ff_h264_idct_add8_neon;
c->h264_idct8_add = ff_h264_idct8_add_neon;
c->h264_idct8_dc_add = ff_h264_idct8_dc_add_neon;

View File

@ -41,10 +41,10 @@ function ff_scalarproduct_int16_neon, export=1
vpadd.s32 d16, d0, d1
vpadd.s32 d17, d2, d3
vpadd.s32 d10, d4, d5
vpadd.s32 d11, d6, d7
vpadd.s32 d18, d4, d5
vpadd.s32 d19, d6, d7
vpadd.s32 d0, d16, d17
vpadd.s32 d1, d10, d11
vpadd.s32 d1, d18, d19
vpadd.s32 d2, d0, d1
vpaddl.s32 d3, d2
vmov.32 r0, d3[0]
@ -81,10 +81,10 @@ function ff_scalarproduct_and_madd_int16_neon, export=1
vpadd.s32 d16, d0, d1
vpadd.s32 d17, d2, d3
vpadd.s32 d10, d4, d5
vpadd.s32 d11, d6, d7
vpadd.s32 d18, d4, d5
vpadd.s32 d19, d6, d7
vpadd.s32 d0, d16, d17
vpadd.s32 d1, d10, d11
vpadd.s32 d1, d18, d19
vpadd.s32 d2, d0, d1
vpaddl.s32 d3, d2
vmov.32 r0, d3[0]

View File

@ -22,7 +22,6 @@
#include "config.h"
#include "libavutil/arm/asm.S"
#if HAVE_ARMV5TE_EXTERNAL
function ff_prefetch_arm, export=1
subs r2, r2, #1
pld [r0]
@ -30,4 +29,3 @@ function ff_prefetch_arm, export=1
bne ff_prefetch_arm
bx lr
endfunc
#endif

View File

@ -19,7 +19,7 @@
*/
#include "libavutil/arm/cpu.h"
#include <libavcodec/videodsp.h>
#include "libavcodec/videodsp.h"
#include "videodsp_arm.h"
void ff_prefetch_arm(uint8_t *mem, ptrdiff_t stride, int h);

View File

@ -124,14 +124,14 @@ function ff_vp8_luma_dc_wht_armv6, export=1
sbfx r1, r9, #3, #13
sbfx r10, r4, #3, #13
#else
sxth r8, r8
sxth r7, r7
sxth r9, r9
sxth r4, r4
asr r8, #3 @ block[0][0]
asr r7, #3 @ block[0][1]
asr r9, #3 @ block[0][2]
asr r4, #3 @ block[0][3]
sxth r6, r8
sxth r12, r7
sxth r1, r9
sxth r10, r4
asr r6, #3 @ block[0][0]
asr r12, #3 @ block[0][1]
asr r1, #3 @ block[0][2]
asr r10, #3 @ block[0][3]
#endif
strh r6, [r0], #32

View File

@ -282,6 +282,11 @@ static av_cold int decode_init(AVCodecContext *avctx)
const int scale = avctx->codec_id == AV_CODEC_ID_ASV1 ? 1 : 2;
int i;
if (avctx->extradata_size < 1) {
av_log(avctx, AV_LOG_ERROR, "No extradata provided\n");
return AVERROR_INVALIDDATA;
}
ff_asv_common_init(avctx);
init_vlcs(a);
ff_init_scantable(a->dsp.idct_permutation, &a->scantable, ff_asv_scantab);

View File

@ -165,7 +165,10 @@ static int decode_bytes(const uint8_t *input, uint8_t *out, int bytes)
off = (intptr_t)input & 3;
buf = (const uint32_t *)(input - off);
c = av_be2ne32((0x537F6103 >> (off * 8)) | (0x537F6103 << (32 - (off * 8))));
if (off)
c = av_be2ne32((0x537F6103U >> (off * 8)) | (0x537F6103U << (32 - (off * 8))));
else
c = av_be2ne32(0x537F6103U);
bytes += 3 + off;
for (i = 0; i < bytes / 4; i++)
output[i] = c ^ buf[i];
@ -518,7 +521,7 @@ static int add_tonal_components(float *spectrum, int num_components,
output = &spectrum[components[i].pos];
for (j = 0; j < components[i].num_coefs; j++)
output[i] += input[i];
output[j] += input[j];
}
return last_pos;
@ -662,8 +665,8 @@ static int decode_channel_sound_unit(ATRAC3Context *q, GetBitContext *gb,
snd->num_components = decode_tonal_components(gb, snd->components,
snd->bands_coded);
if (snd->num_components == -1)
return -1;
if (snd->num_components < 0)
return snd->num_components;
num_subbands = decode_spectrum(gb, snd->spectrum);
@ -740,7 +743,7 @@ static int decode_frame(AVCodecContext *avctx, const uint8_t *databuf,
/* set the bitstream reader at the start of the second Sound Unit*/
init_get_bits(&q->gb, ptr1, avctx->block_align * 8);
init_get_bits(&q->gb, ptr1, (avctx->block_align - i) * 8);
/* Fill the Weighting coeffs delay buffer */
memmove(q->weighting_delay, &q->weighting_delay[2],
@ -949,9 +952,11 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx)
if (q->coding_mode == STEREO)
av_log(avctx, AV_LOG_DEBUG, "Normal stereo detected.\n");
else if (q->coding_mode == JOINT_STEREO)
else if (q->coding_mode == JOINT_STEREO) {
if (avctx->channels != 2)
return AVERROR_INVALIDDATA;
av_log(avctx, AV_LOG_DEBUG, "Joint stereo detected.\n");
else {
} else {
av_log(avctx, AV_LOG_ERROR, "Unknown channel coding mode %x!\n",
q->coding_mode);
return AVERROR_INVALIDDATA;

View File

@ -283,7 +283,7 @@ int av_packet_split_side_data(AVPacket *pkt){
for (i=0; ; i++){
size= AV_RB32(p);
av_assert0(size<=INT_MAX && p - pkt->data >= size);
pkt->side_data[i].data = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
pkt->side_data[i].data = av_mallocz(size + FF_INPUT_BUFFER_PADDING_SIZE);
pkt->side_data[i].size = size;
pkt->side_data[i].type = p[4]&127;
if (!pkt->side_data[i].data)

View File

@ -170,7 +170,7 @@ static void init_lengths(BinkContext *c, int width, int bw)
*
* @param c decoder context
*/
static av_cold void init_bundles(BinkContext *c)
static av_cold int init_bundles(BinkContext *c)
{
int bw, bh, blocks;
int i;
@ -181,8 +181,12 @@ static av_cold void init_bundles(BinkContext *c)
for (i = 0; i < BINKB_NB_SRC; i++) {
c->bundle[i].data = av_malloc(blocks * 64);
if (!c->bundle[i].data)
return AVERROR(ENOMEM);
c->bundle[i].data_end = c->bundle[i].data + blocks * 64;
}
return 0;
}
/**
@ -681,6 +685,9 @@ static int read_dct_coeffs(GetBitContext *gb, int32_t block[64], const uint8_t *
}
}
if (quant_idx >= 16)
return AVERROR_INVALIDDATA;
quant = quant_matrices[quant_idx];
block[0] = (block[0] * quant[0]) >> 11;
@ -1264,7 +1271,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
BinkContext * const c = avctx->priv_data;
static VLC_TYPE table[16 * 128][2];
static int binkb_initialised = 0;
int i;
int i, ret;
int flags;
c->version = avctx->codec_tag >> 24;
@ -1299,7 +1306,10 @@ static av_cold int decode_init(AVCodecContext *avctx)
ff_dsputil_init(&c->dsp, avctx);
ff_binkdsp_init(&c->bdsp);
init_bundles(c);
if ((ret = init_bundles(c)) < 0) {
free_bundles(c);
return ret;
}
if (c->version == 'b') {
if (!binkb_initialised) {

View File

@ -140,7 +140,7 @@ static int decode_bmv_frame(const uint8_t *source, int src_len, uint8_t *frame,
mode += 1 + advance_mode;
if (mode >= 4)
mode -= 3;
if (FFABS(dst_end - dst) < len)
if (len <= 0 || FFABS(dst_end - dst) < len)
return -1;
switch (mode) {
case 1:

View File

@ -325,6 +325,32 @@ static av_always_inline unsigned int bytestream2_get_eof(PutByteContext *p)
return p->eof;
}
static av_always_inline unsigned int bytestream2_copy_bufferu(PutByteContext *p,
GetByteContext *g,
unsigned int size)
{
memcpy(p->buffer, g->buffer, size);
p->buffer += size;
g->buffer += size;
return size;
}
static av_always_inline unsigned int bytestream2_copy_buffer(PutByteContext *p,
GetByteContext *g,
unsigned int size)
{
int size2;
if (p->eof)
return 0;
size = FFMIN(g->buffer_end - g->buffer, size);
size2 = FFMIN(p->buffer_end - p->buffer, size);
if (size2 != size)
p->eof = 1;
return bytestream2_copy_bufferu(p, g, size2);
}
static av_always_inline unsigned int bytestream_get_buffer(const uint8_t **b,
uint8_t *dst,
unsigned int size)

View File

@ -305,7 +305,7 @@ STOP_TIMER("get_cabac_bypass")
for(i=0; i<SIZE; i++){
START_TIMER
if( (r[i]&1) != get_cabac(&c, state) )
if( (r[i]&1) != get_cabac_noinline(&c, state) )
av_log(NULL, AV_LOG_ERROR, "CABAC failure at %d\n", i);
STOP_TIMER("get_cabac")
}

View File

@ -604,8 +604,9 @@ static inline int decode_residual_inter(AVSContext *h)
/* get coded block pattern */
int cbp = get_ue_golomb(&h->gb);
if (cbp > 63U) {
av_log(h->avctx, AV_LOG_ERROR, "illegal inter cbp\n");
if (cbp > 63 || cbp < 0) {
av_log(h->avctx, AV_LOG_ERROR, "illegal inter cbp %d\n", cbp);
return -1;
}
h->cbp = cbp_tab[cbp][1];
@ -675,7 +676,7 @@ static int decode_mb_i(AVSContext *h, int cbp_code)
/* get coded block pattern */
if (h->cur.f->pict_type == AV_PICTURE_TYPE_I)
cbp_code = get_ue_golomb(gb);
if (cbp_code > 63U) {
if (cbp_code > 63 || cbp_code < 0) {
av_log(h->avctx, AV_LOG_ERROR, "illegal intra cbp\n");
return -1;
}
@ -944,6 +945,11 @@ static int decode_pic(AVSContext *h)
int ret;
enum cavs_mb mb_type;
if (!h->top_qp) {
av_log(h->avctx, AV_LOG_ERROR, "No sequence header decoded yet\n");
return AVERROR_INVALIDDATA;
}
skip_bits(&h->gb, 16);//bbv_dwlay
if (h->stc == PIC_PB_START_CODE) {
h->cur.f->pict_type = get_bits(&h->gb, 2) + AV_PICTURE_TYPE_I;
@ -973,7 +979,8 @@ static int decode_pic(AVSContext *h)
if (h->cur.f->data[0])
h->avctx->release_buffer(h->avctx, h->cur.f);
if ((ret = ff_get_buffer(h->avctx, h->cur.f)) < 0)
ret = ff_get_buffer(h->avctx, h->cur.f);
if (ret < 0)
return ret;
if (!h->edge_emu_buffer) {

View File

@ -269,7 +269,7 @@ static void cdg_scroll(CDGraphicsContext *cc, uint8_t *data,
static int cdg_decode_frame(AVCodecContext *avctx,
void *data, int *got_frame, AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
GetByteContext gb;
int buf_size = avpkt->size;
int ret;
uint8_t command, inst;
@ -286,17 +286,19 @@ static int cdg_decode_frame(AVCodecContext *avctx,
return AVERROR(EINVAL);
}
bytestream2_init(&gb, avpkt->data, avpkt->size);
ret = avctx->reget_buffer(avctx, &cc->frame);
if (ret) {
av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
return ret;
}
command = bytestream_get_byte(&buf);
inst = bytestream_get_byte(&buf);
command = bytestream2_get_byte(&gb);
inst = bytestream2_get_byte(&gb);
inst &= CDG_MASK;
buf += 2; /// skipping 2 unneeded bytes
bytestream_get_buffer(&buf, cdg_data, buf_size - CDG_HEADER_SIZE);
bytestream2_skip(&gb, 2);
bytestream2_get_buffer(&gb, cdg_data, sizeof(cdg_data));
if ((command & CDG_MASK) == CDG_COMMAND) {
switch (inst) {
@ -355,11 +357,10 @@ static int cdg_decode_frame(AVCodecContext *avctx,
*got_frame = 1;
} else {
*got_frame = 0;
buf_size = 0;
}
*(AVFrame *) data = cc->frame;
return buf_size;
return avpkt->size;
}
static av_cold int cdg_decode_end(AVCodecContext *avctx)

View File

@ -738,10 +738,10 @@ static int dca_parse_frame_header(DCAContext *s)
s->lfe = get_bits(&s->gb, 2);
s->predictor_history = get_bits(&s->gb, 1);
if (s->lfe == 3) {
if (s->lfe > 2) {
s->lfe = 0;
av_log_ask_for_sample(s->avctx, "LFE is 3\n");
return AVERROR_PATCHWELCOME;
av_log(s->avctx, AV_LOG_ERROR, "Invalid LFE value: %d\n", s->lfe);
return AVERROR_INVALIDDATA;
}
/* TODO: check CRC */
@ -971,7 +971,13 @@ static int dca_subframe_header(DCAContext *s, int base_channel, int block_index)
"Invalid channel mode %d\n", am);
return AVERROR_INVALIDDATA;
}
for (j = base_channel; j < FFMIN(s->prim_channels, FF_ARRAY_ELEMS(dca_default_coeffs[am])); j++) {
if (s->prim_channels > FF_ARRAY_ELEMS(dca_default_coeffs[0])) {
av_log_ask_for_sample(s->avctx, "Downmixing %d channels",
s->prim_channels);
return AVERROR_PATCHWELCOME;
}
for (j = base_channel; j < s->prim_channels; j++) {
s->downmix_coef[j][0] = dca_default_coeffs[am][j][0];
s->downmix_coef[j][1] = dca_default_coeffs[am][j][1];
}
@ -1425,6 +1431,7 @@ static int dca_subsubframe(DCAContext *s, int base_channel, int block_index)
#endif
} else {
av_log(s->avctx, AV_LOG_ERROR, "Didn't get subframe DSYNC\n");
return AVERROR_INVALIDDATA;
}
}

View File

@ -263,6 +263,8 @@ static int decode_wdlt(GetByteContext *gb, uint8_t *frame, int width, int height
segments = bytestream2_get_le16(gb);
}
line_ptr = frame;
if (frame_end - frame < width)
return AVERROR_INVALIDDATA;
frame += width;
y++;
while (segments--) {

View File

@ -237,7 +237,7 @@ static int parse_source_parameters(AVCodecContext *avctx, GetBitContext *gb,
avctx->pix_fmt = dirac_pix_fmt[!luma_offset][source->chroma_format];
avcodec_get_chroma_sub_sample(avctx->pix_fmt, &chroma_x_shift, &chroma_y_shift);
if (!(source->width % (1<<chroma_x_shift)) || !(source->height % (1<<chroma_y_shift))) {
if ((source->width % (1<<chroma_x_shift)) || (source->height % (1<<chroma_y_shift))) {
av_log(avctx, AV_LOG_ERROR, "Dimensions must be a integer multiply of the chroma subsampling\n");
return AVERROR_INVALIDDATA;
}

View File

@ -28,6 +28,7 @@
#ifndef AVCODEC_DIRAC_ARITH_H
#define AVCODEC_DIRAC_ARITH_H
#include "libavutil/x86/asm.h"
#include "bytestream.h"
#include "get_bits.h"
@ -134,7 +135,7 @@ static inline int dirac_get_arith_bit(DiracArith *c, int ctx)
range_times_prob = (c->range * prob_zero) >> 16;
#if HAVE_FAST_CMOV && HAVE_INLINE_ASM
#if HAVE_FAST_CMOV && HAVE_INLINE_ASM && HAVE_6REGS
low -= range_times_prob << 16;
range -= range_times_prob;
bit = 0;

View File

@ -200,6 +200,7 @@ typedef struct DiracContext {
uint16_t *mctmp; /* buffer holding the MC data multipled by OBMC weights */
uint8_t *mcscratch;
int buffer_stride;
DECLARE_ALIGNED(16, uint8_t, obmc_weight)[3][MAX_BLOCKSIZE*MAX_BLOCKSIZE];
@ -342,22 +343,44 @@ static int alloc_sequence_buffers(DiracContext *s)
return AVERROR(ENOMEM);
}
w = s->source.width;
h = s->source.height;
/* fixme: allocate using real stride here */
s->sbsplit = av_malloc(sbwidth * sbheight);
s->blmotion = av_malloc(sbwidth * sbheight * 16 * sizeof(*s->blmotion));
s->edge_emu_buffer_base = av_malloc((w+64)*MAX_BLOCKSIZE);
s->sbsplit = av_malloc_array(sbwidth, sbheight);
s->blmotion = av_malloc_array(sbwidth, sbheight * 16 * sizeof(*s->blmotion));
s->mctmp = av_malloc((w+64+MAX_BLOCKSIZE) * (h+MAX_BLOCKSIZE) * sizeof(*s->mctmp));
s->mcscratch = av_malloc((w+64)*MAX_BLOCKSIZE);
if (!s->sbsplit || !s->blmotion || !s->mctmp || !s->mcscratch)
if (!s->sbsplit || !s->blmotion)
return AVERROR(ENOMEM);
return 0;
}
static int alloc_buffers(DiracContext *s, int stride)
{
int w = s->source.width;
int h = s->source.height;
av_assert0(stride >= w);
stride += 64;
if (s->buffer_stride >= stride)
return 0;
s->buffer_stride = 0;
av_freep(&s->edge_emu_buffer_base);
memset(s->edge_emu_buffer, 0, sizeof(s->edge_emu_buffer));
av_freep(&s->mctmp);
av_freep(&s->mcscratch);
s->edge_emu_buffer_base = av_malloc_array(stride, MAX_BLOCKSIZE);
s->mctmp = av_malloc_array((stride+MAX_BLOCKSIZE), (h+MAX_BLOCKSIZE) * sizeof(*s->mctmp));
s->mcscratch = av_malloc_array(stride, MAX_BLOCKSIZE);
if (!s->edge_emu_buffer_base || !s->mctmp || !s->mcscratch)
return AVERROR(ENOMEM);
s->buffer_stride = stride;
return 0;
}
static void free_sequence_buffers(DiracContext *s)
{
int i, j, k;
@ -381,6 +404,7 @@ static void free_sequence_buffers(DiracContext *s)
av_freep(&s->plane[i].idwt_tmp);
}
s->buffer_stride = 0;
av_freep(&s->sbsplit);
av_freep(&s->blmotion);
av_freep(&s->edge_emu_buffer_base);
@ -1342,8 +1366,8 @@ static int mc_subpel(DiracContext *s, DiracBlock *block, const uint8_t *src[5],
motion_y >>= s->chroma_y_shift;
}
mx = motion_x & ~(-1 << s->mv_precision);
my = motion_y & ~(-1 << s->mv_precision);
mx = motion_x & ~(-1U << s->mv_precision);
my = motion_y & ~(-1U << s->mv_precision);
motion_x >>= s->mv_precision;
motion_y >>= s->mv_precision;
/* normalize subpel coordinates to epel */
@ -1817,6 +1841,9 @@ static int dirac_decode_data_unit(AVCodecContext *avctx, const uint8_t *buf, int
s->plane[1].stride = pic->avframe.linesize[1];
s->plane[2].stride = pic->avframe.linesize[2];
if (alloc_buffers(s, FFMAX3(FFABS(s->plane[0].stride), FFABS(s->plane[1].stride), FFABS(s->plane[2].stride))) < 0)
return AVERROR(ENOMEM);
/* [DIRAC_STD] 11.1 Picture parse. picture_parse() */
if (dirac_decode_picture_header(s))
return -1;

View File

@ -39,6 +39,7 @@ typedef struct DNXHDContext {
GetBitContext gb;
int64_t cid; ///< compression id
unsigned int width, height;
enum AVPixelFormat pix_fmt;
unsigned int mb_width, mb_height;
uint32_t mb_scan_index[68]; /* max for 1080p */
int cur_field; ///< current interlaced field
@ -135,7 +136,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, const uint8_t *buf, int buf_si
av_dlog(ctx->avctx, "width %d, height %d\n", ctx->width, ctx->height);
if (buf[0x21] & 0x40) {
ctx->avctx->pix_fmt = AV_PIX_FMT_YUV422P10;
ctx->pix_fmt = AV_PIX_FMT_YUV422P10;
ctx->avctx->bits_per_raw_sample = 10;
if (ctx->bit_depth != 10) {
ff_dsputil_init(&ctx->dsp, ctx->avctx);
@ -143,7 +144,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, const uint8_t *buf, int buf_si
ctx->decode_dct_block = dnxhd_decode_dct_block_10;
}
} else {
ctx->avctx->pix_fmt = AV_PIX_FMT_YUV422P;
ctx->pix_fmt = AV_PIX_FMT_YUV422P;
ctx->avctx->bits_per_raw_sample = 8;
if (ctx->bit_depth != 8) {
ff_dsputil_init(&ctx->dsp, ctx->avctx);
@ -381,9 +382,15 @@ static int dnxhd_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
avctx->width, avctx->height, ctx->width, ctx->height);
first_field = 1;
}
if (avctx->pix_fmt != AV_PIX_FMT_NONE && avctx->pix_fmt != ctx->pix_fmt) {
av_log(avctx, AV_LOG_WARNING, "pix_fmt changed: %s -> %s\n",
av_get_pix_fmt_name(avctx->pix_fmt), av_get_pix_fmt_name(ctx->pix_fmt));
first_field = 1;
}
if (av_image_check_size(ctx->width, ctx->height, 0, avctx))
return -1;
avctx->pix_fmt = ctx->pix_fmt;
avcodec_set_dimensions(avctx, ctx->width, ctx->height);
if (first_field) {
@ -406,7 +413,7 @@ static int dnxhd_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
*picture = ctx->picture;
*got_frame = 1;
return buf_size;
return avpkt->size;
}
static av_cold int dnxhd_decode_close(AVCodecContext *avctx)

View File

@ -235,7 +235,7 @@ static int dnxhd_init_qmat(DNXHDEncContext *ctx, int lbias, int cbias)
static int dnxhd_init_rc(DNXHDEncContext *ctx)
{
FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->mb_rc, 8160*ctx->m.avctx->qmax*sizeof(RCEntry), fail);
FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->mb_rc, 8160*(ctx->m.avctx->qmax + 1)*sizeof(RCEntry), fail);
if (ctx->m.avctx->mb_decision != FF_MB_DECISION_RD)
FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->mb_cmp, ctx->m.mb_num*sizeof(RCCMPEntry), fail);
@ -629,14 +629,35 @@ static void dnxhd_setup_threads_slices(DNXHDEncContext *ctx)
static int dnxhd_mb_var_thread(AVCodecContext *avctx, void *arg, int jobnr, int threadnr)
{
DNXHDEncContext *ctx = avctx->priv_data;
int mb_y = jobnr, mb_x;
int mb_y = jobnr, mb_x, x, y;
int partial_last_row = (mb_y == ctx->m.mb_height - 1) &&
((avctx->height >> ctx->interlaced) & 0xF);
ctx = ctx->thread[threadnr];
if (ctx->cid_table->bit_depth == 8) {
uint8_t *pix = ctx->thread[0]->src[0] + ((mb_y<<4) * ctx->m.linesize);
for (mb_x = 0; mb_x < ctx->m.mb_width; ++mb_x, pix += 16) {
unsigned mb = mb_y * ctx->m.mb_width + mb_x;
int sum = ctx->m.dsp.pix_sum(pix, ctx->m.linesize);
int varc = (ctx->m.dsp.pix_norm1(pix, ctx->m.linesize) - (((unsigned)sum*sum)>>8)+128)>>8;
int sum;
int varc;
if (!partial_last_row && mb_x * 16 <= avctx->width - 16) {
sum = ctx->m.dsp.pix_sum(pix, ctx->m.linesize);
varc = ctx->m.dsp.pix_norm1(pix, ctx->m.linesize);
} else {
int bw = FFMIN(avctx->width - 16 * mb_x, 16);
int bh = FFMIN((avctx->height >> ctx->interlaced) - 16 * mb_y, 16);
sum = varc = 0;
for (y = 0; y < bh; y++) {
for (x = 0; x < bw; x++) {
uint8_t val = pix[x + y * ctx->m.linesize];
sum += val;
varc += val * val;
}
}
}
varc = (varc - (((unsigned)sum * sum) >> 8) + 128) >> 8;
ctx->mb_cmp[mb].value = varc;
ctx->mb_cmp[mb].mb = mb;
}

View File

@ -212,6 +212,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
buf[803] = s->bits_per_component;
write16(buf + 804, (s->bits_per_component == 10 || s->bits_per_component == 12) ?
1 : 0); /* packing method */
write32(buf + 808, HEADER_SIZE); /* data offset */
/* Image source information header */
write32(buf + 1628, avctx->sample_aspect_ratio.num);

View File

@ -128,27 +128,30 @@ static av_cold int cinvideo_decode_init(AVCodecContext *avctx)
return 0;
}
static void cin_apply_delta_data(const unsigned char *src, unsigned char *dst, int size)
static void cin_apply_delta_data(const unsigned char *src, unsigned char *dst,
int size)
{
while (size--)
*dst++ += *src++;
}
static int cin_decode_huffman(const unsigned char *src, int src_size, unsigned char *dst, int dst_size)
static int cin_decode_huffman(const unsigned char *src, int src_size,
unsigned char *dst, int dst_size)
{
int b, huff_code = 0;
unsigned char huff_code_table[15];
unsigned char *dst_cur = dst;
unsigned char *dst_end = dst + dst_size;
unsigned char *dst_cur = dst;
unsigned char *dst_end = dst + dst_size;
const unsigned char *src_end = src + src_size;
memcpy(huff_code_table, src, 15); src += 15;
memcpy(huff_code_table, src, 15);
src += 15;
while (src < src_end) {
huff_code = *src++;
if ((huff_code >> 4) == 15) {
b = huff_code << 4;
huff_code = *src++;
b = huff_code << 4;
huff_code = *src++;
*dst_cur++ = b | (huff_code >> 4);
} else
*dst_cur++ = huff_code_table[huff_code >> 4];
@ -167,11 +170,12 @@ static int cin_decode_huffman(const unsigned char *src, int src_size, unsigned c
return dst_cur - dst;
}
static int cin_decode_lzss(const unsigned char *src, int src_size, unsigned char *dst, int dst_size)
static int cin_decode_lzss(const unsigned char *src, int src_size,
unsigned char *dst, int dst_size)
{
uint16_t cmd;
int i, sz, offset, code;
unsigned char *dst_end = dst + dst_size, *dst_start = dst;
unsigned char *dst_end = dst + dst_size, *dst_start = dst;
const unsigned char *src_end = src + src_size;
while (src < src_end && dst < dst_end) {
@ -180,13 +184,15 @@ static int cin_decode_lzss(const unsigned char *src, int src_size, unsigned char
if (code & (1 << i)) {
*dst++ = *src++;
} else {
cmd = AV_RL16(src); src += 2;
cmd = AV_RL16(src);
src += 2;
offset = cmd >> 4;
if ((int) (dst - dst_start) < offset + 1)
if ((int)(dst - dst_start) < offset + 1)
return AVERROR_INVALIDDATA;
sz = (cmd & 0xF) + 2;
/* don't use memcpy/memmove here as the decoding routine (ab)uses */
/* buffer overlappings to repeat bytes in the destination */
/* don't use memcpy/memmove here as the decoding routine
* (ab)uses buffer overlappings to repeat bytes in the
* destination */
sz = FFMIN(sz, dst_end - dst);
while (sz--) {
*dst = *(dst - offset - 1);
@ -199,10 +205,11 @@ static int cin_decode_lzss(const unsigned char *src, int src_size, unsigned char
return 0;
}
static int cin_decode_rle(const unsigned char *src, int src_size, unsigned char *dst, int dst_size)
static int cin_decode_rle(const unsigned char *src, int src_size,
unsigned char *dst, int dst_size)
{
int len, code;
unsigned char *dst_end = dst + dst_size;
unsigned char *dst_end = dst + dst_size;
const unsigned char *src_end = src + src_size;
while (src + 1 < src_end && dst < dst_end) {
@ -216,7 +223,7 @@ static int cin_decode_rle(const unsigned char *src, int src_size, unsigned char
av_log(NULL, AV_LOG_ERROR, "RLE overread\n");
return AVERROR_INVALIDDATA;
}
memcpy(dst, src, FFMIN(len, dst_end - dst));
memcpy(dst, src, FFMIN3(len, dst_end - dst, src_end - src));
src += len;
}
dst += len;
@ -228,15 +235,16 @@ static int cinvideo_decode_frame(AVCodecContext *avctx,
void *data, int *got_frame,
AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
CinVideoContext *cin = avctx->priv_data;
int i, y, palette_type, palette_colors_count, bitmap_frame_type, bitmap_frame_size, res = 0;
int i, y, palette_type, palette_colors_count,
bitmap_frame_type, bitmap_frame_size, res = 0;
palette_type = buf[0];
palette_colors_count = AV_RL16(buf+1);
bitmap_frame_type = buf[3];
buf += 4;
palette_type = buf[0];
palette_colors_count = AV_RL16(buf + 1);
bitmap_frame_type = buf[3];
buf += 4;
bitmap_frame_size = buf_size - 4;
@ -247,46 +255,50 @@ static int cinvideo_decode_frame(AVCodecContext *avctx,
if (palette_colors_count > 256)
return AVERROR_INVALIDDATA;
for (i = 0; i < palette_colors_count; ++i) {
cin->palette[i] = 0xFFU << 24 | bytestream_get_le24(&buf);
cin->palette[i] = 0xFFU << 24 | bytestream_get_le24(&buf);
bitmap_frame_size -= 3;
}
} else {
for (i = 0; i < palette_colors_count; ++i) {
cin->palette[buf[0]] = 0xFFU << 24 | AV_RL24(buf+1);
cin->palette[buf[0]] = 0xFFU << 24 | AV_RL24(buf + 1);
buf += 4;
bitmap_frame_size -= 4;
}
}
/* note: the decoding routines below assumes that surface.width = surface.pitch */
bitmap_frame_size = FFMIN(cin->bitmap_size, bitmap_frame_size);
/* note: the decoding routines below assumes that
* surface.width = surface.pitch */
switch (bitmap_frame_type) {
case 9:
cin_decode_rle(buf, bitmap_frame_size,
cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size);
cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size);
break;
case 34:
cin_decode_rle(buf, bitmap_frame_size,
cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size);
cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size);
cin_apply_delta_data(cin->bitmap_table[CIN_PRE_BMP],
cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size);
cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size);
break;
case 35:
bitmap_frame_size = cin_decode_huffman(buf, bitmap_frame_size,
cin->bitmap_table[CIN_INT_BMP], cin->bitmap_size);
cin_decode_rle(cin->bitmap_table[CIN_INT_BMP], bitmap_frame_size,
cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size);
cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size);
break;
case 36:
bitmap_frame_size = cin_decode_huffman(buf, bitmap_frame_size,
cin->bitmap_table[CIN_INT_BMP], cin->bitmap_size);
cin->bitmap_table[CIN_INT_BMP],
cin->bitmap_size);
cin_decode_rle(cin->bitmap_table[CIN_INT_BMP], bitmap_frame_size,
cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size);
cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size);
cin_apply_delta_data(cin->bitmap_table[CIN_PRE_BMP],
cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size);
cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size);
break;
case 37:
cin_decode_huffman(buf, bitmap_frame_size,
cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size);
cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size);
break;
case 38:
res = cin_decode_lzss(buf, bitmap_frame_size,
@ -302,12 +314,12 @@ static int cinvideo_decode_frame(AVCodecContext *avctx,
if (res < 0)
return res;
cin_apply_delta_data(cin->bitmap_table[CIN_PRE_BMP],
cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size);
cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size);
break;
}
cin->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
if ((res = avctx->reget_buffer(avctx, &cin->frame))) {
if ((res = avctx->reget_buffer(avctx, &cin->frame)) < 0) {
av_log(cin->avctx, AV_LOG_ERROR, "failed to allocate a frame\n");
return res;
}
@ -316,10 +328,11 @@ static int cinvideo_decode_frame(AVCodecContext *avctx,
cin->frame.palette_has_changed = 1;
for (y = 0; y < cin->avctx->height; ++y)
memcpy(cin->frame.data[0] + (cin->avctx->height - 1 - y) * cin->frame.linesize[0],
cin->bitmap_table[CIN_CUR_BMP] + y * cin->avctx->width,
cin->avctx->width);
cin->bitmap_table[CIN_CUR_BMP] + y * cin->avctx->width,
cin->avctx->width);
FFSWAP(uint8_t *, cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_table[CIN_PRE_BMP]);
FFSWAP(uint8_t *, cin->bitmap_table[CIN_CUR_BMP],
cin->bitmap_table[CIN_PRE_BMP]);
*got_frame = 1;
*(AVFrame *)data = cin->frame;
@ -358,8 +371,8 @@ static av_cold int cinaudio_decode_init(AVCodecContext *avctx)
static int cinaudio_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame_ptr, AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
CinAudioContext *cin = avctx->priv_data;
const uint8_t *buf = avpkt->data;
CinAudioContext *cin = avctx->priv_data;
const uint8_t *buf_end = buf + avpkt->size;
int16_t *samples;
int delta, ret;
@ -375,13 +388,13 @@ static int cinaudio_decode_frame(AVCodecContext *avctx, void *data,
delta = cin->delta;
if (cin->initial_decode_frame) {
cin->initial_decode_frame = 0;
delta = sign_extend(AV_RL16(buf), 16);
buf += 2;
*samples++ = delta;
delta = sign_extend(AV_RL16(buf), 16);
buf += 2;
*samples++ = delta;
}
while (buf < buf_end) {
delta += cinaudio_delta16_table[*buf++];
delta = av_clip_int16(delta);
delta += cinaudio_delta16_table[*buf++];
delta = av_clip_int16(delta);
*samples++ = delta;
}
cin->delta = delta;
@ -392,7 +405,6 @@ static int cinaudio_decode_frame(AVCodecContext *avctx, void *data,
return avpkt->size;
}
AVCodec ff_dsicinvideo_decoder = {
.name = "dsicinvideo",
.type = AVMEDIA_TYPE_VIDEO,

View File

@ -1922,7 +1922,7 @@ void ff_set_cmp(DSPContext* c, me_cmp_func *cmp, int type){
static void add_bytes_c(uint8_t *dst, uint8_t *src, int w){
long i;
for(i=0; i<=w-sizeof(long); i+=sizeof(long)){
for (i = 0; i <= w - (int) sizeof(long); i += sizeof(long)) {
long a = *(long*)(src+i);
long b = *(long*)(dst+i);
*(long*)(dst+i) = ((a&pb_7f) + (b&pb_7f)) ^ ((a^b)&pb_80);
@ -1947,7 +1947,7 @@ static void diff_bytes_c(uint8_t *dst, const uint8_t *src1, const uint8_t *src2,
}
}else
#endif
for(i=0; i<=w-sizeof(long); i+=sizeof(long)){
for (i = 0; i <= w - (int) sizeof(long); i += sizeof(long)) {
long a = *(long*)(src1+i);
long b = *(long*)(src2+i);
*(long*)(dst+i) = ((a|pb_80) - (b&pb_7f)) ^ ((a^b^pb_80)&pb_80);

View File

@ -350,11 +350,6 @@ static av_cold int dvvideo_init_encoder(AVCodecContext *avctx)
static const int vs_total_ac_bits = (100 * 4 + 68*2) * 5;
static const int mb_area_start[5] = { 1, 6, 21, 43, 64 };
static inline int put_bits_left(PutBitContext* s)
{
return (s->buf_end - s->buf) * 8 - put_bits_count(s);
}
#if CONFIG_SMALL
/* Converts run and level (where level != 0) pair into VLC, returning bit size */
static av_always_inline int dv_rl2vlc(int run, int level, int sign, uint32_t* vlc)

View File

@ -45,8 +45,11 @@ static int dvdsub_parse(AVCodecParserContext *s,
DVDSubParseContext *pc = s->priv_data;
if (pc->packet_index == 0) {
if (buf_size < 2)
return 0;
if (buf_size < 2 || AV_RB16(buf) && buf_size < 6) {
if (buf_size)
av_log(avctx, AV_LOG_DEBUG, "Parser input %d too small\n", buf_size);
return buf_size;
}
pc->packet_len = AV_RB16(buf);
if (pc->packet_len == 0) /* HD-DVD subpicture packet */
pc->packet_len = AV_RB32(buf+2);

View File

@ -98,6 +98,12 @@ static int decode_rle(uint8_t *bitmap, int linesize, int w, int h,
int x, y, len, color;
uint8_t *d;
if (start >= buf_size)
return -1;
if (w <= 0 || h <= 0)
return -1;
bit_len = (buf_size - start) * 8;
init_get_bits(&gb, buf + start, bit_len);
@ -339,10 +345,12 @@ static int decode_dvd_subtitles(DVDSubContext *ctx, AVSubtitle *sub_header,
sub_header->rects[0] = av_mallocz(sizeof(AVSubtitleRect));
sub_header->num_rects = 1;
sub_header->rects[0]->pict.data[0] = bitmap;
decode_rle(bitmap, w * 2, w, (h + 1) / 2,
buf, offset1, buf_size, is_8bit);
decode_rle(bitmap + w, w * 2, w, h / 2,
buf, offset2, buf_size, is_8bit);
if (decode_rle(bitmap, w * 2, w, (h + 1) / 2,
buf, offset1, buf_size, is_8bit) < 0)
goto fail;
if (decode_rle(bitmap + w, w * 2, w, h / 2,
buf, offset2, buf_size, is_8bit) < 0)
goto fail;
sub_header->rects[0]->pict.data[1] = av_mallocz(AVPALETTE_SIZE);
if (is_8bit) {
if (yuv_palette == 0)

View File

@ -255,6 +255,12 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
case 5:
c->pic.key_frame = !(compr & 1);
c->pic.pict_type = (compr & 1) ? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_I;
if (!tmpptr && !c->pic.key_frame) {
av_log(avctx, AV_LOG_ERROR, "Missing reference frame.\n");
return AVERROR_INVALIDDATA;
}
for(j = 0; j < avctx->height; j++){
if((compr & 1) && tmpptr){
for(i = 0; i < avctx->width; i++)
@ -298,6 +304,11 @@ static av_cold int decode_init(AVCodecContext *avctx)
avctx->pix_fmt = AV_PIX_FMT_PAL8;
if (avctx->width%4 || avctx->height%4) {
av_log(avctx, AV_LOG_ERROR, "dimensions are not a multiple of 4");
return AVERROR_INVALIDDATA;
}
avcodec_get_frame_defaults(&c->pic);
avcodec_get_frame_defaults(&c->prev);

View File

@ -114,8 +114,8 @@ static void cmv_decode_inter(CmvContext * s, const uint8_t *buf, const uint8_t *
int yoffset = ((buf[i] >> 4)) - 7;
if (s->last_frame.data[0])
cmv_motcomp(s->frame.data[0], s->frame.linesize[0],
s->last_frame.data[0], s->last_frame.linesize[0],
x*4, y*4, xoffset, yoffset, s->avctx->width, s->avctx->height);
s->last_frame.data[0], s->last_frame.linesize[0],
x*4, y*4, xoffset, yoffset, s->avctx->width, s->avctx->height);
}
i++;
}
@ -123,7 +123,7 @@ static void cmv_decode_inter(CmvContext * s, const uint8_t *buf, const uint8_t *
static void cmv_process_header(CmvContext *s, const uint8_t *buf, const uint8_t *buf_end)
{
int pal_start, pal_count, i;
int pal_start, pal_count, i, fps;
if(buf_end - buf < 16) {
av_log(s->avctx, AV_LOG_WARNING, "truncated header\n");
@ -135,8 +135,9 @@ static void cmv_process_header(CmvContext *s, const uint8_t *buf, const uint8_t
if (s->avctx->width!=s->width || s->avctx->height!=s->height)
avcodec_set_dimensions(s->avctx, s->width, s->height);
s->avctx->time_base.num = 1;
s->avctx->time_base.den = AV_RL16(&buf[10]);
fps = AV_RL16(&buf[10]);
if (fps > 0)
s->avctx->time_base = (AVRational){ 1, fps };
pal_start = AV_RL16(&buf[12]);
pal_count = AV_RL16(&buf[14]);

View File

@ -29,6 +29,7 @@
*/
#include "avcodec.h"
#include "bytestream.h"
#include "get_bits.h"
#include "dsputil.h"
#include "aandcttab.h"
@ -139,6 +140,11 @@ static inline int decode_block_intra(MadContext *s, DCTELEM * block)
break;
} else if (level != 0) {
i += run;
if (i > 63) {
av_log(s->avctx, AV_LOG_ERROR,
"ac-tex damaged at %d %d\n", s->mb_x, s->mb_y);
return -1;
}
j = scantable[i];
level = (level*quant_matrix[j]) >> 4;
level = (level-1)|1;
@ -153,6 +159,11 @@ static inline int decode_block_intra(MadContext *s, DCTELEM * block)
run = SHOW_UBITS(re, &s->gb, 6)+1; LAST_SKIP_BITS(re, &s->gb, 6);
i += run;
if (i > 63) {
av_log(s->avctx, AV_LOG_ERROR,
"ac-tex damaged at %d %d\n", s->mb_x, s->mb_y);
return -1;
}
j = scantable[i];
if (level < 0) {
level = -level;
@ -164,10 +175,6 @@ static inline int decode_block_intra(MadContext *s, DCTELEM * block)
level = (level-1)|1;
}
}
if (i > 63) {
av_log(s->avctx, AV_LOG_ERROR, "ac-tex damaged at %d %d\n", s->mb_x, s->mb_y);
return -1;
}
block[j] = level;
}
@ -232,32 +239,34 @@ static int decode_frame(AVCodecContext *avctx,
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
const uint8_t *buf_end = buf+buf_size;
MadContext *s = avctx->priv_data;
GetByteContext gb;
int width, height, ret;
int chunk_type;
int inter;
if (buf_size < 26) {
av_log(avctx, AV_LOG_ERROR, "Input buffer too small\n");
*got_frame = 0;
bytestream2_init(&gb, buf, buf_size);
chunk_type = bytestream2_get_le32(&gb);
inter = (chunk_type == MADm_TAG || chunk_type == MADe_TAG);
bytestream2_skip(&gb, 10);
av_reduce(&avctx->time_base.num, &avctx->time_base.den,
bytestream2_get_le16(&gb), 1000, 1<<30);
width = bytestream2_get_le16(&gb);
height = bytestream2_get_le16(&gb);
bytestream2_skip(&gb, 1);
calc_quant_matrix(s, bytestream2_get_byte(&gb));
bytestream2_skip(&gb, 2);
if (bytestream2_get_bytes_left(&gb) < 2) {
av_log(avctx, AV_LOG_ERROR, "Input data too small\n");
return AVERROR_INVALIDDATA;
}
chunk_type = AV_RL32(&buf[0]);
inter = (chunk_type == MADm_TAG || chunk_type == MADe_TAG);
buf += 8;
av_reduce(&avctx->time_base.num, &avctx->time_base.den,
AV_RL16(&buf[6]), 1000, 1<<30);
width = AV_RL16(&buf[8]);
height = AV_RL16(&buf[10]);
calc_quant_matrix(s, buf[13]);
buf += 16;
if (avctx->width != width || avctx->height != height) {
if((width * height)/2048*7 > buf_end-buf)
if((width * height)/2048*7 > bytestream2_get_bytes_left(&gb))
return AVERROR_INVALIDDATA;
if ((ret = av_image_check_size(width, height, 0, avctx)) < 0)
return ret;
@ -276,14 +285,29 @@ static int decode_frame(AVCodecContext *avctx,
}
}
if (inter && !s->last_frame.data[0]) {
int ret;
av_log(avctx, AV_LOG_WARNING, "Missing reference frame.\n");
s->last_frame.reference = 1;
ret = ff_get_buffer(avctx, &s->last_frame);
if (ret < 0)
return ret;
memset(s->last_frame.data[0], 0, s->last_frame.height *
s->last_frame.linesize[0]);
memset(s->last_frame.data[1], 0x80, s->last_frame.height / 2 *
s->last_frame.linesize[1]);
memset(s->last_frame.data[2], 0x80, s->last_frame.height / 2 *
s->last_frame.linesize[2]);
}
av_fast_padded_malloc(&s->bitstream_buf, &s->bitstream_buf_size,
buf_end - buf);
bytestream2_get_bytes_left(&gb));
if (!s->bitstream_buf)
return AVERROR(ENOMEM);
s->dsp.bswap16_buf(s->bitstream_buf, (const uint16_t*)buf, (buf_end-buf)/2);
memset((uint8_t*)s->bitstream_buf + (buf_end-buf), 0, FF_INPUT_BUFFER_PADDING_SIZE);
init_get_bits(&s->gb, s->bitstream_buf, 8*(buf_end-buf));
s->dsp.bswap16_buf(s->bitstream_buf, (const uint16_t *)(buf + bytestream2_tell(&gb)),
bytestream2_get_bytes_left(&gb) / 2);
memset((uint8_t*)s->bitstream_buf + bytestream2_get_bytes_left(&gb), 0, FF_INPUT_BUFFER_PADDING_SIZE);
init_get_bits(&s->gb, s->bitstream_buf, 8*(bytestream2_get_bytes_left(&gb)));
for (s->mb_y=0; s->mb_y < (avctx->height+15)/16; s->mb_y++)
for (s->mb_x=0; s->mb_x < (avctx->width +15)/16; s->mb_x++)
if(decode_mb(s, inter) < 0)

View File

@ -924,6 +924,12 @@ void ff_er_frame_end(MpegEncContext *s)
return;
};
if (s->picture_structure == PICT_FRAME &&
s->current_picture.f.linesize[0] != s->current_picture_ptr->f.linesize[0]) {
av_log(s->avctx, AV_LOG_ERROR, "Error concealment not possible, frame not fully initialized\n");
return;
}
if (s->current_picture.f.motion_val[0] == NULL) {
av_log(s->avctx, AV_LOG_ERROR, "Warning MVs not available\n");

View File

@ -247,7 +247,7 @@ static void put_line(uint8_t *dst, int size, int width, const int *runs)
PutBitContext pb;
int run, mode = ~0, pix_left = width, run_idx = 0;
init_put_bits(&pb, dst, size*8);
init_put_bits(&pb, dst, size);
while(pix_left > 0){
run = runs[run_idx++];
mode = ~mode;

View File

@ -112,6 +112,7 @@ static void fft_ref(FFTComplex *tabr, FFTComplex *tab, int nbits)
}
}
#if CONFIG_MDCT
static void imdct_ref(FFTSample *out, FFTSample *in, int nbits)
{
int n = 1<<nbits;
@ -146,8 +147,10 @@ static void mdct_ref(FFTSample *output, FFTSample *input, int nbits)
output[k] = REF_SCALE(s, nbits - 1);
}
}
#endif /* CONFIG_MDCT */
#if CONFIG_FFT_FLOAT
#if CONFIG_DCT
static void idct_ref(FFTSample *output, FFTSample *input, int nbits)
{
int n = 1<<nbits;
@ -180,6 +183,7 @@ static void dct_ref(FFTSample *output, FFTSample *input, int nbits)
output[k] = s;
}
}
#endif /* CONFIG_DCT */
#endif
@ -305,6 +309,7 @@ int main(int argc, char **argv)
tab2 = av_malloc(fft_size * sizeof(FFTSample));
switch (transform) {
#if CONFIG_MDCT
case TRANSFORM_MDCT:
av_log(NULL, AV_LOG_INFO,"Scale factor is set to %f\n", scale);
if (do_inverse)
@ -313,6 +318,7 @@ int main(int argc, char **argv)
av_log(NULL, AV_LOG_INFO,"MDCT");
ff_mdct_init(m, fft_nbits, do_inverse, scale);
break;
#endif /* CONFIG_MDCT */
case TRANSFORM_FFT:
if (do_inverse)
av_log(NULL, AV_LOG_INFO,"IFFT");
@ -322,6 +328,7 @@ int main(int argc, char **argv)
fft_ref_init(fft_nbits, do_inverse);
break;
#if CONFIG_FFT_FLOAT
#if CONFIG_RDFT
case TRANSFORM_RDFT:
if (do_inverse)
av_log(NULL, AV_LOG_INFO,"IDFT_C2R");
@ -330,6 +337,8 @@ int main(int argc, char **argv)
ff_rdft_init(r, fft_nbits, do_inverse ? IDFT_C2R : DFT_R2C);
fft_ref_init(fft_nbits, do_inverse);
break;
#endif /* CONFIG_RDFT */
#if CONFIG_DCT
case TRANSFORM_DCT:
if (do_inverse)
av_log(NULL, AV_LOG_INFO,"DCT_III");
@ -337,6 +346,7 @@ int main(int argc, char **argv)
av_log(NULL, AV_LOG_INFO,"DCT_II");
ff_dct_init(d, fft_nbits, do_inverse ? DCT_III : DCT_II);
break;
#endif /* CONFIG_DCT */
#endif
default:
av_log(NULL, AV_LOG_ERROR, "Requested transform not supported\n");
@ -355,6 +365,7 @@ int main(int argc, char **argv)
av_log(NULL, AV_LOG_INFO,"Checking...\n");
switch (transform) {
#if CONFIG_MDCT
case TRANSFORM_MDCT:
if (do_inverse) {
imdct_ref((FFTSample *)tab_ref, (FFTSample *)tab1, fft_nbits);
@ -368,6 +379,7 @@ int main(int argc, char **argv)
err = check_diff((FFTSample *)tab_ref, tab2, fft_size / 2, scale);
}
break;
#endif /* CONFIG_MDCT */
case TRANSFORM_FFT:
memcpy(tab, tab1, fft_size * sizeof(FFTComplex));
s->fft_permute(s, tab);
@ -377,6 +389,7 @@ int main(int argc, char **argv)
err = check_diff((FFTSample *)tab_ref, (FFTSample *)tab, fft_size * 2, 1.0);
break;
#if CONFIG_FFT_FLOAT
#if CONFIG_RDFT
case TRANSFORM_RDFT:
fft_size_2 = fft_size >> 1;
if (do_inverse) {
@ -408,6 +421,8 @@ int main(int argc, char **argv)
err = check_diff((float *)tab_ref, (float *)tab2, fft_size, 1.0);
}
break;
#endif /* CONFIG_RDFT */
#if CONFIG_DCT
case TRANSFORM_DCT:
memcpy(tab, tab1, fft_size * sizeof(FFTComplex));
d->dct_calc(d, (FFTSample *)tab);
@ -418,6 +433,7 @@ int main(int argc, char **argv)
}
err = check_diff((float *)tab_ref, (float *)tab, fft_size, 1.0);
break;
#endif /* CONFIG_DCT */
#endif
}
@ -469,19 +485,25 @@ int main(int argc, char **argv)
}
switch (transform) {
#if CONFIG_MDCT
case TRANSFORM_MDCT:
ff_mdct_end(m);
break;
#endif /* CONFIG_MDCT */
case TRANSFORM_FFT:
ff_fft_end(s);
break;
#if CONFIG_FFT_FLOAT
#if CONFIG_RDFT
case TRANSFORM_RDFT:
ff_rdft_end(r);
break;
#endif /* CONFIG_RDFT */
#if CONFIG_DCT
case TRANSFORM_DCT:
ff_dct_end(d);
break;
#endif /* CONFIG_DCT */
#endif
}

View File

@ -447,6 +447,10 @@ static int read_extra_header(FFV1Context *f)
ff_build_rac_states(c, 0.05 * (1LL << 32), 256 - 8);
f->version = get_symbol(c, state, 0);
if (f->version < 2) {
av_log(f->avctx, AV_LOG_ERROR, "Invalid version in global header\n");
return AVERROR_INVALIDDATA;
}
if (f->version > 2) {
c->bytestream_end -= 4;
f->minor_version = get_symbol(c, state, 0);
@ -524,6 +528,7 @@ static int read_header(FFV1Context *f)
memset(state, 128, sizeof(state));
if (f->version < 2) {
int chroma_planes, chroma_h_shift, chroma_v_shift, transparency, colorspace, bits_per_raw_sample;
unsigned v= get_symbol(c, state, 0);
if (v >= 2) {
av_log(f->avctx, AV_LOG_ERROR, "invalid version %d in ver01 header\n", v);
@ -536,15 +541,32 @@ static int read_header(FFV1Context *f)
f->state_transition[i] = get_symbol(c, state, 1) + c->one_state[i];
}
f->colorspace = get_symbol(c, state, 0); //YUV cs type
colorspace = get_symbol(c, state, 0); //YUV cs type
bits_per_raw_sample = f->version > 0 ? get_symbol(c, state, 0) : f->avctx->bits_per_raw_sample;
chroma_planes = get_rac(c, state);
chroma_h_shift = get_symbol(c, state, 0);
chroma_v_shift = get_symbol(c, state, 0);
transparency = get_rac(c, state);
if (f->version > 0)
f->avctx->bits_per_raw_sample = get_symbol(c, state, 0);
if (f->plane_count) {
if (colorspace != f->colorspace ||
bits_per_raw_sample != f->avctx->bits_per_raw_sample ||
chroma_planes != f->chroma_planes ||
chroma_h_shift != f->chroma_h_shift ||
chroma_v_shift != f->chroma_v_shift ||
transparency != f->transparency) {
av_log(f->avctx, AV_LOG_ERROR, "Invalid change of global parameters\n");
return AVERROR_INVALIDDATA;
}
}
f->colorspace = colorspace;
f->avctx->bits_per_raw_sample = bits_per_raw_sample;
f->chroma_planes = chroma_planes;
f->chroma_h_shift = chroma_h_shift;
f->chroma_v_shift = chroma_v_shift;
f->transparency = transparency;
f->chroma_planes = get_rac(c, state);
f->chroma_h_shift = get_symbol(c, state, 0);
f->chroma_v_shift = get_symbol(c, state, 0);
f->transparency = get_rac(c, state);
f->plane_count = 2 + f->transparency;
}

View File

@ -275,7 +275,7 @@ static av_always_inline int encode_line(FFV1Context *s, int w,
int run_mode = 0;
if (s->ac) {
if (c->bytestream_end - c->bytestream < w * 20) {
if (c->bytestream_end - c->bytestream < w * 35) {
av_log(s->avctx, AV_LOG_ERROR, "encoded frame too large\n");
return AVERROR_INVALIDDATA;
}

View File

@ -655,7 +655,7 @@ static int flac_parse(AVCodecParserContext *s, AVCodecContext *avctx,
handle_error:
*poutbuf = NULL;
*poutbuf_size = 0;
return read_end - buf;
return buf_size ? read_end - buf : 0;
}
static int flac_parse_init(AVCodecParserContext *c)

View File

@ -27,7 +27,7 @@ const int ff_flac_sample_rate_table[16] =
8000, 16000, 22050, 24000, 32000, 44100, 48000, 96000,
0, 0, 0, 0 };
const int16_t ff_flac_blocksize_table[16] = {
const int32_t ff_flac_blocksize_table[16] = {
0, 192, 576<<0, 576<<1, 576<<2, 576<<3, 0, 0,
256<<0, 256<<1, 256<<2, 256<<3, 256<<4, 256<<5, 256<<6, 256<<7
};

View File

@ -26,6 +26,6 @@
extern const int ff_flac_sample_rate_table[16];
extern const int16_t ff_flac_blocksize_table[16];
extern const int32_t ff_flac_blocksize_table[16];
#endif /* AVCODEC_FLACDATA_H */

View File

@ -467,10 +467,10 @@ static int decode_frame(FLACContext *s)
ret = allocate_buffers(s);
if (ret < 0)
return ret;
ff_flacdsp_init(&s->dsp, s->avctx->sample_fmt, s->bps);
s->got_streaminfo = 1;
dump_headers(s->avctx, (FLACStreaminfo *)s);
}
ff_flacdsp_init(&s->dsp, s->avctx->sample_fmt, s->bps);
// dump_headers(s->avctx, (FLACStreaminfo *)s);

View File

@ -389,6 +389,12 @@ static int flashsv_decode_frame(AVCodecContext *avctx, void *data,
}
s->diff_start = get_bits(&gb, 8);
s->diff_height = get_bits(&gb, 8);
if (s->diff_start + s->diff_height > cur_blk_height) {
av_log(avctx, AV_LOG_ERROR,
"Block parameters invalid: %d + %d > %d\n",
s->diff_start, s->diff_height, cur_blk_height);
return AVERROR_INVALIDDATA;
}
av_log(avctx, AV_LOG_DEBUG,
"%dx%d diff start %d height %d\n",
i, j, s->diff_start, s->diff_height);

View File

@ -288,7 +288,7 @@ static int write_header(FlashSV2Context * s, uint8_t * buf, int buf_size)
if (buf_size < 5)
return -1;
init_put_bits(&pb, buf, buf_size * 8);
init_put_bits(&pb, buf, buf_size);
put_bits(&pb, 4, (s->block_width >> 4) - 1);
put_bits(&pb, 12, s->image_width);

View File

@ -131,7 +131,7 @@ static int encode_bitstream(FlashSVContext *s, AVFrame *p, uint8_t *buf,
int buf_pos, res;
int pred_blocks = 0;
init_put_bits(&pb, buf, buf_size * 8);
init_put_bits(&pb, buf, buf_size);
put_bits(&pb, 4, block_width / 16 - 1);
put_bits(&pb, 12, s->image_width);

View File

@ -387,6 +387,11 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx,
if (bytestream2_tell(&g2) + 1 > stream_ptr_after_chunk)
break;
byte_run = sign_extend(bytestream2_get_byte(&g2), 8);
if (!byte_run) {
av_log(avctx, AV_LOG_ERROR, "Invalid byte run value.\n");
return AVERROR_INVALIDDATA;
}
if (byte_run > 0) {
palette_idx1 = bytestream2_get_byte(&g2);
CHECK_PIXEL_PTR(byte_run);

View File

@ -145,6 +145,11 @@ static int decode_frame(AVCodecContext *avctx,
enum AVPixelFormat pix_fmt;
int ret;
if (buf_size < 4) {
av_log(avctx, AV_LOG_ERROR, "Packet is too short\n");
return AVERROR_INVALIDDATA;
}
header = AV_RL32(buf);
version = header & 0xff;
header_size = (header & (1<<30))? 8 : 4; /* bit 30 means pad to 8 bytes */
@ -216,7 +221,7 @@ static int decode_frame(AVCodecContext *avctx,
return ret;
}
switch(version) {
switch (version) {
case 0:
default:
/* Fraps v0 is a reordered YUV420 */
@ -226,13 +231,13 @@ static int decode_frame(AVCodecContext *avctx,
return AVERROR_INVALIDDATA;
}
buf32=(const uint32_t*)buf;
for(y=0; y<avctx->height/2; y++){
luma1=(uint32_t*)&f->data[0][ y*2*f->linesize[0] ];
luma2=(uint32_t*)&f->data[0][ (y*2+1)*f->linesize[0] ];
cr=(uint32_t*)&f->data[1][ y*f->linesize[1] ];
cb=(uint32_t*)&f->data[2][ y*f->linesize[2] ];
for(x=0; x<avctx->width; x+=8){
buf32 = (const uint32_t*)buf;
for (y = 0; y < avctx->height / 2; y++) {
luma1 = (uint32_t*)&f->data[0][ y * 2 * f->linesize[0] ];
luma2 = (uint32_t*)&f->data[0][ (y * 2 + 1) * f->linesize[0] ];
cr = (uint32_t*)&f->data[1][ y * f->linesize[1] ];
cb = (uint32_t*)&f->data[2][ y * f->linesize[2] ];
for(x=0; x<avctx->width; x+=8) {
*luma1++ = *buf32++;
*luma1++ = *buf32++;
*luma2++ = *buf32++;
@ -245,10 +250,10 @@ static int decode_frame(AVCodecContext *avctx,
case 1:
/* Fraps v1 is an upside-down BGR24 */
for(y=0; y<avctx->height; y++)
memcpy(&f->data[0][ (avctx->height-y)*f->linesize[0] ],
&buf[y*avctx->width*3],
3*avctx->width);
for (y = 0; y < avctx->height; y++)
memcpy(&f->data[0][ (avctx->height - y - 1) * f->linesize[0]],
&buf[y * avctx->width * 3],
3 * avctx->width);
break;
case 2:

View File

@ -2292,7 +2292,8 @@ static int pack_bitstream(G723_1_Context *p, unsigned char *frame, int size)
if (p->cur_rate == RATE_6300) {
info_bits = 0;
put_bits(&pb, 2, info_bits);
}
}else
av_assert0(0);
put_bits(&pb, 8, p->lsp_index[2]);
put_bits(&pb, 8, p->lsp_index[1]);

View File

@ -366,25 +366,49 @@ static inline int check_marker(GetBitContext *s, const char *msg)
}
/**
* Inititalize GetBitContext.
* @param buffer bitstream buffer, must be FF_INPUT_BUFFER_PADDING_SIZE bytes larger than the actual read bits
* because some optimized bitstream readers read 32 or 64 bit at once and could read over the end
* Initialize GetBitContext.
* @param buffer bitstream buffer, must be FF_INPUT_BUFFER_PADDING_SIZE bytes
* larger than the actual read bits because some optimized bitstream
* readers read 32 or 64 bit at once and could read over the end
* @param bit_size the size of the buffer in bits
* @return 0 on success, AVERROR_INVALIDDATA if the buffer_size would overflow.
*/
static inline void init_get_bits(GetBitContext *s, const uint8_t *buffer,
int bit_size)
static inline int init_get_bits(GetBitContext *s, const uint8_t *buffer,
int bit_size)
{
int buffer_size = (bit_size+7)>>3;
if (buffer_size < 0 || bit_size < 0) {
int buffer_size;
int ret = 0;
if (bit_size >= INT_MAX - 7 || bit_size < 0 || !buffer) {
buffer_size = bit_size = 0;
buffer = NULL;
ret = AVERROR_INVALIDDATA;
}
buffer_size = (bit_size + 7) >> 3;
s->buffer = buffer;
s->size_in_bits = bit_size;
s->size_in_bits_plus8 = bit_size + 8;
s->buffer_end = buffer + buffer_size;
s->index = 0;
return ret;
}
/**
* Initialize GetBitContext.
* @param buffer bitstream buffer, must be FF_INPUT_BUFFER_PADDING_SIZE bytes
* larger than the actual read bits because some optimized bitstream
* readers read 32 or 64 bit at once and could read over the end
* @param byte_size the size of the buffer in bytes
* @return 0 on success, AVERROR_INVALIDDATA if the buffer_size would overflow.
*/
static inline int init_get_bits8(GetBitContext *s, const uint8_t *buffer,
int byte_size)
{
if (byte_size > INT_MAX / 8 || byte_size < 0)
byte_size = -1;
return init_get_bits(s, buffer, byte_size * 8);
}
static inline void align_get_bits(GetBitContext *s)

View File

@ -65,8 +65,8 @@ typedef struct GifState {
int stored_img_size;
int stored_bg_color;
GetByteContext gb;
/* LZW compatible decoder */
GetByteContext gb;
LZWState *lzw;
/* aux buffers */
@ -75,6 +75,7 @@ typedef struct GifState {
AVCodecContext *avctx;
int keyframe;
int keyframe_ok;
int trans_color; /**< color value that is used instead of transparent color */
} GifState;
@ -118,7 +119,7 @@ static void gif_copy_img_rect(const uint32_t *src, uint32_t *dst,
const uint32_t *src_px, *src_pr,
*src_py = src + y_start,
*dst_py = dst + y_start;
const uint32_t *src_pb = src_py + t * linesize;
const uint32_t *src_pb = src_py + h * linesize;
uint32_t *dst_px;
for (; src_py < src_pb; src_py += linesize, dst_py += linesize) {
@ -143,11 +144,11 @@ static int gif_read_image(GifState *s)
if (bytestream2_get_bytes_left(&s->gb) < 9)
return AVERROR_INVALIDDATA;
left = bytestream2_get_le16u(&s->gb);
top = bytestream2_get_le16u(&s->gb);
width = bytestream2_get_le16u(&s->gb);
left = bytestream2_get_le16u(&s->gb);
top = bytestream2_get_le16u(&s->gb);
width = bytestream2_get_le16u(&s->gb);
height = bytestream2_get_le16u(&s->gb);
flags = bytestream2_get_byteu(&s->gb);
flags = bytestream2_get_byteu(&s->gb);
is_interleaved = flags & 0x40;
has_local_palette = flags & 0x80;
bits_per_pixel = (flags & 0x07) + 1;
@ -184,8 +185,11 @@ static int gif_read_image(GifState *s)
/* verify that all the image is inside the screen dimensions */
if (left + width > s->screen_width ||
top + height > s->screen_height)
top + height > s->screen_height ||
!width || !height) {
av_log(s->avctx, AV_LOG_ERROR, "Invalid image dimensions.\n");
return AVERROR_INVALIDDATA;
}
/* process disposal method */
if (s->gce_prev_disposal == GCE_DISPOSAL_BACKGROUND) {
@ -252,26 +256,21 @@ static int gif_read_image(GifState *s)
case 1:
y1 += 8;
ptr += linesize * 8;
if (y1 >= height) {
y1 = pass ? 2 : 4;
ptr = ptr1 + linesize * y1;
pass++;
}
break;
case 2:
y1 += 4;
ptr += linesize * 4;
if (y1 >= height) {
y1 = 1;
ptr = ptr1 + linesize;
pass++;
}
break;
case 3:
y1 += 2;
ptr += linesize * 2;
break;
}
while (y1 >= height) {
y1 = 4 >> pass;
ptr = ptr1 + linesize * y1;
pass++;
}
} else {
ptr += linesize;
}
@ -313,7 +312,7 @@ static int gif_read_extension(GifState *s)
if (bytestream2_get_bytes_left(&s->gb) < 5)
return AVERROR_INVALIDDATA;
gce_flags = bytestream2_get_byteu(&s->gb);
gce_flags = bytestream2_get_byteu(&s->gb);
bytestream2_skipu(&s->gb, 2); // delay during which the frame is shown
gce_transparent_index = bytestream2_get_byteu(&s->gb);
if (gce_flags & 0x01)
@ -367,7 +366,7 @@ static int gif_read_header1(GifState *s)
/* read screen header */
s->transparent_color_index = -1;
s->screen_width = bytestream2_get_le16u(&s->gb);
s->screen_width = bytestream2_get_le16u(&s->gb);
s->screen_height = bytestream2_get_le16u(&s->gb);
if( (unsigned)s->screen_width > 32767
|| (unsigned)s->screen_height > 32767){
@ -410,10 +409,10 @@ static int gif_read_header1(GifState *s)
static int gif_parse_next_image(GifState *s, int *got_picture)
{
int ret;
*got_picture = 1;
while (bytestream2_get_bytes_left(&s->gb)) {
while (bytestream2_get_bytes_left(&s->gb) > 0) {
int code = bytestream2_get_byte(&s->gb);
int ret;
av_dlog(s->avctx, "code=%02x '%c'\n", code, code);
@ -458,9 +457,9 @@ static int gif_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, A
bytestream2_init(&s->gb, avpkt->data, avpkt->size);
s->picture.pts = avpkt->pts;
s->picture.pkt_pts = avpkt->pts;
s->picture.pkt_dts = avpkt->dts;
s->picture.pts = avpkt->pts;
s->picture.pkt_pts = avpkt->pts;
s->picture.pkt_dts = avpkt->dts;
s->picture.pkt_duration = avpkt->duration;
if (avpkt->size >= 6) {
@ -471,6 +470,8 @@ static int gif_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, A
}
if (s->keyframe) {
s->keyframe_ok = 0;
s->gce_prev_disposal = GCE_DISPOSAL_NONE;
if ((ret = gif_read_header1(s)) < 0)
return ret;
@ -488,7 +489,13 @@ static int gif_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, A
s->picture.pict_type = AV_PICTURE_TYPE_I;
s->picture.key_frame = 1;
s->keyframe_ok = 1;
} else {
if (!s->keyframe_ok) {
av_log(avctx, AV_LOG_ERROR, "cannot decode frame without keyframe\n");
return AVERROR_INVALIDDATA;
}
if ((ret = avctx->reget_buffer(avctx, &s->picture)) < 0) {
av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
return ret;
@ -504,7 +511,7 @@ static int gif_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, A
else if (*got_frame)
*picture = s->picture;
return avpkt->size;
return bytestream2_tell(&s->gb);
}
static av_cold int gif_decode_close(AVCodecContext *avctx)

View File

@ -291,9 +291,11 @@ static int h261_decode_mb(H261Context *h){
// Read mtype
h->mtype = get_vlc2(&s->gb, h261_mtype_vlc.table, H261_MTYPE_VLC_BITS, 2);
if (h->mtype < 0) {
av_log(s->avctx, AV_LOG_ERROR, "illegal mtype %d\n", h->mtype);
av_log(s->avctx, AV_LOG_ERROR, "Invalid mtype index %d\n",
h->mtype);
return SLICE_ERROR;
}
av_assert0(h->mtype < FF_ARRAY_ELEMS(ff_h261_mtype_map));
h->mtype = ff_h261_mtype_map[h->mtype];
// Read mquant

Some files were not shown because too many files have changed in this diff Show More