r3d: check that sampling rate is non negative.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
huffyuvdec: Check init_vlc() return codes.

Prevents out of array writes

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
huffyuvdec: check for and propagate failures from inside generate_joint_tables()

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