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
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
mpeg: Split error resilience bits off into a separate file
dsputil: Split bswap*_buf() off into a separate context
Merge commit '44127546b0a81dc9dd6190739a62d48f0044c6f3'

* commit '44127546b0a81dc9dd6190739a62d48f0044c6f3':
  Check if an mp3 header is using a reserved sample rate.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
Merge commit 'f2f2e7627f0c878d13275af5d166ec5932665e28'

* commit 'f2f2e7627f0c878d13275af5d166ec5932665e28':
  Check mp3 header before calling avpriv_mpegaudio_decode_header().

Conflicts:
	libavformat/mp3enc.c

See: 2dd0da787ce5008d4d1b8f461fbd1288c32e2c38
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Merge commit '7b9ef8d701c319c26f7d0664fe977e176764c74e'

* commit '7b9ef8d701c319c26f7d0664fe977e176764c74e':
  mpeg: Split error resilience bits off into a separate file

Conflicts:
	configure
	libavcodec/Makefile
	libavcodec/mpegvideo.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
indeo45: use is_indeo4 context flag instead of checking codec ID

Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
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
Merge commit 'c67b449bebbe0b35c73b203683e77a0a649bc765'

* commit 'c67b449bebbe0b35c73b203683e77a0a649bc765':
  dsputil: Split bswap*_buf() off into a separate context

Conflicts:
	configure
	libavcodec/4xm.c
	libavcodec/ac3dec.c
	libavcodec/ac3dec.h
	libavcodec/apedec.c
	libavcodec/eamad.c
	libavcodec/flacenc.c
	libavcodec/fraps.c
	libavcodec/huffyuv.c
	libavcodec/huffyuvdec.c
	libavcodec/motionpixels.c
	libavcodec/truemotion2.c
	libavcodec/x86/Makefile
	libavcodec/x86/dsputil_init.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
Merge commit 'e121ac634ba324a318f4a97f978dcfb48da6b735'

* commit 'e121ac634ba324a318f4a97f978dcfb48da6b735':
  indeo45: use is_indeo4 context flag instead of checking codec ID

Merged-by: Michael Niedermayer <michaelni@gmx.at>
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>
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>
Merge commit 'ccda51b14c0fcae2fad73a24872dce75a7964996'

* commit 'ccda51b14c0fcae2fad73a24872dce75a7964996':
  lzo: Handle integer overflow

Conflicts:
	libavutil/lzo.c

This is basically not merging changes due to this being fixed differently
in FFmpeg

See: d6af26c55c1ea30f85a7d9edbc373f53be1743ee
See: cf2b7c01f81c1fb3283a1390c0ca9a2f81f4f4a8
Merged-by: Michael Niedermayer <michaelni@gmx.at>
h264: avoid using uninitialized memory in NEON chroma mc

Adapt commit 982b596ea6640bfe218a31f6c3fc542d9fe61c31 for the arm and
aarch64 NEON asm. 5-10% faster on Cortex-A9.
dsputil: Split off global motion compensation bits into a separate context
Merge commit 'f23d26a6864128001b03876b0b92fffe131f2060'

* commit 'f23d26a6864128001b03876b0b92fffe131f2060':
  h264: avoid using uninitialized memory in NEON chroma mc

Merged-by: Michael Niedermayer <michaelni@gmx.at>
Merge commit 'fab9df63a3156ffe1f9490aafaea41e03ef60ddf'

* commit 'fab9df63a3156ffe1f9490aafaea41e03ef60ddf':
  dsputil: Split off global motion compensation bits into a separate context

Conflicts:
	libavcodec/dsputil.c
	libavcodec/dsputil.h
	libavcodec/ppc/dsputil_altivec.h
	libavcodec/x86/dsputil_init.c
	libavcodec/x86/dsputil_mmx.c
	libavcodec/x86/dsputil_x86.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
x86/dsputil: move put_signed_pixels_clamped out of bswapdsp.asm

It's still a dsputil function

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pixfmt: mark the reserved values