avcodec/bitstream: Check bits in ff_init_vlc_sparse()

Fixes out of array reads

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/bitstream: check codes in ff_init_vlc_sparse()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Fix pgc compilation with --disable-optimizations.

-O1 disables dead code elimination on pgc, use -O instead.