mpegvideo: unref buffers in ff_mpeg_unref_picture on frame size changes

ff_mpeg_unref_picture clears the flag indicating that the frame needs to
be reallocated after a frame size change. Since we have now reference
counted buffers we can unref the buffers immediately.
pixdesc: mark gray8 as pseudopal

Many functions treat it as such already.
Fixes Bug 499.

CC:libav-stable@libav.org
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
wavpack: check packet size early

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
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>
Merge commit '3eae9b030cbbdc263f69834b791624613032d548'

* commit '3eae9b030cbbdc263f69834b791624613032d548':
  mpegvideo: unref buffers in ff_mpeg_unref_picture on frame size changes

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

* commit 'f36d7831d96aeb072db5a2b78892a534d96e288e':
  pixdesc: mark gray8 as pseudopal

Conflicts:
	libavutil/pixdesc.c

No change as gray8 was already marked as pseudopal in FFmpeg

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

* commit '3f0b6d7a6248a33df37b98cfcb37a1acce263f62':
  wavpack: use bytestream2 in wavpack_decode_block

Conflicts:
	libavcodec/wavpack.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
Merge remote-tracking branch 'qatar/master'

* qatar/master:
  wavpack: check packet size early

Merged-by: Michael Niedermayer <michaelni@gmx.at>
doc/general: remove obsolete info about APE decoder

Signed-off-by: Paul B Mahol <onemda@gmail.com>
fraps: set avctx->color_range

Signed-off-by: Paul B Mahol <onemda@gmail.com>
avcodec/wavpack: remove ;;

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
escape130: switch to init_get_bits8()

Signed-off-by: Paul B Mahol <onemda@gmail.com>
s302m encoder

Signed-off-by: Paul B Mahol <onemda@gmail.com>
postproc/postprocess_template: remove empty comments

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/mpegvideo: remove empty comments

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avformat/mtv: remove empty comments

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/libfaac: fallback to a supported bitrate if the requested is not supported

Fixes: Ticket2587

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
lavfi/testsrc: move color options to the color scope filter definition.
lavfi/testsrc: make nb_decimals available only in testsrc.