Fix memory allocation when decoding a stream changing bitdepth between CVS

This issue might cause a segmentation fault.
6 jobs for !1972 with fix_segfault_bitdepth_change in 15 minutes and 13 seconds (queued for 1 second)
detached
Status Job ID Name Coverage
  Build
passed #19667
macos
build_macos

00:04:38

passed #19668
ubuntu1604
build_ubuntu1604

00:05:52

passed #19669
ubuntu1804
build_ubuntu1804

00:05:52

passed #19670
ubuntu1804-gcc8
build_ubuntu1804-gcc8

00:06:37

passed #19671
vc191x
build_vc191x

00:15:12

passed #19672
vc192x
build_vc192x

00:13:29