swscale: fix an implementation-defined unsigned-to-signed conversion
swscale: fix some undefined signed left shifts

Based on a patch by Michael Niedermayer <michaelni@gmx.at>
swscale: Set alpha to opaque for internal palettes.

Fixes conversion of pal8 to rgb formats with alpha.

Updated references for 2 FATE tests which previously encoded fully
transparent images.

Based on a patch by Baptiste Coudurier <baptiste.coudurier@gmail.com>
tiffdec: rename variables for consistency and fix variable shadowing

Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
tiffdec: use correct data type for palette entries and set alpha to 0xFF
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
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
tiffdec: use bytestream2 to simplify overread/overwrite protection

Based on a patch by Paul B Mahol <onemda@gmail.com>

CC:libav-stable@libav.org
tiffdec: use a single strip if RowsPerStrip is 0

The spec does not specify that 0 is an error condition, and there
are samples which use 0 when the whole image is in one strip.
tiff: use a better name and enum values for PhotometricInterpretation

Also add additional known values and log as missing features.
tiffdec: remove an unneeded variable
tiffdec: support predictor type 2 with RGB48 pixel format
dcadec: Do not decode the XCh extension when downmixing to stereo

This is neither necessary nor currently supported.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
dcadec: Use correct channel count in stereo downmix check

s->prim_channels is greater than num_core_channels
when an XCh extension is present in the bitstream.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Merge commit '60c4660ba035bbfbcc84ac34129ce40e037c70ad'

* commit '60c4660ba035bbfbcc84ac34129ce40e037c70ad':
  swscale: fix an implementation-defined unsigned-to-signed conversion

Conflicts:
	libswscale/swscale_unscaled.c

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

* commit '20c38c9c18b75e62f6c489d9b95bea88efdf3915':
  swscale: fix some undefined signed left shifts

Conflicts:
	libswscale/swscale_unscaled.c

See: 7a32ab5ed0b0523d1868da8232ff15831712a18f
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Merge commit 'd9a542ace1b9ca5c0ea6d758127d03d4124b7801'

* commit 'd9a542ace1b9ca5c0ea6d758127d03d4124b7801':
  swscale: Set alpha to opaque for internal palettes.

Conflicts:
	libswscale/swscale_unscaled.c

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

* commit 'bf2064f046af64c59a416c814474a39b0a457569':
  tiffdec: rename variables for consistency and fix variable shadowing

Conflicts:
	libavcodec/tiff.c

See: 251345a3fe221d60e9b275567085f9475de68092
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Merge commit '58bc38a5f224d29b79338200459792c765c25fd5'

* commit '58bc38a5f224d29b79338200459792c765c25fd5':
  tiffdec: use correct data type for palette entries and set alpha to 0xFF

Conflicts:
	libavcodec/tiff.c

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

* commit 'de9d2705f61ef569487ec5f8974a9c7ce34ec783':
  bytestream: add functions for accessing size of buffer

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