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>
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>
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>
cmdutils: Conditionally compile libswscale-related bits

This fixes compilation with libswscale disabled.

(cherry picked from commit ab799664755c8bc2c439c428ff5b538c105a5c38)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
x86: Fix linking with some or all of yasm, mmx, optimizations disabled

Some optimized template functions reference optimized symbols, so they
must be explicitly disabled when those symbols are unavailable.

(cherry picked from commit ec36aa69448f20a78d8c4588265022e0b2272ab5)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
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 00915d3cd2ce61db3d6dc11f63566630a9aff4ec)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
h264_sei: check SEI size

Signed-off-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
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
h264: slice-mt: check master context for valid current_picture_ptr

Fixes errors in slice based multithreading introduced in 0b300daad2f5.

CC: libav-stable@libav.org
(cherry picked from commit 5945c7b35d9169caf9ecef1c419eebdebb909e60)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
twinvq: fix out of bounds array access

ModeTab.fmode has only 3 elements, so indexing it with ftype
in the initialier for 'size' is invalid when ftype == FT_PPC.

This fixes crashes with gcc 4.8.

Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit 4bf2e7c5f1c0ad3997fd7c9859c16db8e4e16df6)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
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
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>
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>

Conflicts:
	libavcodec/huffyuvdec.c
Merge commit '187cfd3c13a1deb47661486824a5b8f41e158a7a' into release/0.10

* commit '187cfd3c13a1deb47661486824a5b8f41e158a7a':
  eamad: use the bytestream2 API instead of AV_RL

Conflicts:
	libavcodec/eamad.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
Merge commit 'e4fdfdf65d520ce3af13a21ff8a3649e37757af8' into release/0.10

* commit 'e4fdfdf65d520ce3af13a21ff8a3649e37757af8':
  vf_select: Drop a debug av_log with an unchecked double to enum conversion

Merged-by: Michael Niedermayer <michaelni@gmx.at>
Merge commit '277103e07fbe22fc8e4361bacd5c6b48133f3ba5' into release/0.10

* commit '277103e07fbe22fc8e4361bacd5c6b48133f3ba5':
  video4linux2: Avoid a floating point exception

Conflicts:
	avconv.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
Merge commit '28f2d3c5a5a3a3c14a68cf691054f15e4f23355a' into release/0.10

* commit '28f2d3c5a5a3a3c14a68cf691054f15e4f23355a':
  cmdutils: Conditionally compile libswscale-related bits

Conflicts:
	cmdutils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
Merge commit '976f2e0a542e47aaf68ddbe001fb70a00bf96d99' into release/0.10

* commit '976f2e0a542e47aaf68ddbe001fb70a00bf96d99':
  x86: Fix linking with some or all of yasm, mmx, optimizations disabled

Conflicts:
	libavcodec/x86/mpegaudiodec_mmx.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
Merge commit 'a465ed5707f5cbc9713d5e9629d424cd2d46e038' into release/0.10

* commit 'a465ed5707f5cbc9713d5e9629d424cd2d46e038':
  pgssubdec: Check RLE size before copying

Merged-by: Michael Niedermayer <michaelni@gmx.at>
Merge commit '184c79729d4011f33027bcdc61a63d521017ebc1' into release/0.10

* commit '184c79729d4011f33027bcdc61a63d521017ebc1':
  h264_sei: check SEI size

Conflicts:
	libavcodec/h264_sei.c

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