lavr: check that current_buffer is not NULL before using it

Fixes a segfault during resampling when compiled with -DDEBUG.
Fixes all fate-lavr-resample tests with -DDEBUG.

CC:libav-stable@libav.org
mmvideo: fix uninitialized variable use in mm_decode_intra

Signed-off-by: Anton Khirnov <anton@khirnov.net>
avframe: mark source frame const in _ref and _clone

Signed-off-by: Anton Khirnov <anton@khirnov.net>
Merge commit '211ca69b13eb0a127a9ef7e70ddaccdab125d1c5'

* commit '211ca69b13eb0a127a9ef7e70ddaccdab125d1c5':
  lavr: check that current_buffer is not NULL before using it

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

* commit 'fc06ee6ee377cc3b512dff8f02057e26311bc4da':
  mmvideo: fix uninitialized variable use in mm_decode_intra

Conflicts:
	libavcodec/mmvideo.c

See: c2e3b564b32d596f5a66d47409f9e07a067a3084
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Merge commit '529a9893d769f381b72785c500662be2020da5fe'

* commit '529a9893d769f381b72785c500662be2020da5fe':
  avframe: mark source frame const in _ref and _clone

Merged-by: Michael Niedermayer <michaelni@gmx.at>
hevc: add irap checks
(cherry picked from commit 3d3bbe35541a308937d0fe72b20a1c29d1c4100d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
hevc: refactor pic_arrays and set_sps
(cherry picked from commit a6686c6d83b50c0962269f2c487f4f0c57e0df79)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
hevc: add profile idc warning
(cherry picked from commit 15f7a481fd19529b13631bfff5b3d65bfe5729d5)

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