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
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>