h264_cavlc: check the size of the intra PCM data.

Fixes invalid reads.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
gifdec: check that the image dimensions are non-zero

Also add an error message an return a more suitable error code
(INVALIDDATA, not EINVAL);
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
Merge commit '074c769de93bf12e9f44d77e58a8c7167f9dfb13'

* commit '074c769de93bf12e9f44d77e58a8c7167f9dfb13':
  h264_cavlc: check the size of the intra PCM data.

This check is redundant, but does no harm

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

* commit 'c453723ad7d14abc5e82677eebaa6025fa598f08':
  gifdec: check that the image dimensions are non-zero

Conflicts:
	libavcodec/gifdec.c

See: 286930d302fd34cfc2541bfdd760a8bbf9f2d2e5
Merged-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/gifdec: print error if image is not within dimensions

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