matroskaenc: fixed display width / height calculation for stereo mode

Based-on: patch by Asan Usipov <asan.usipov@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/mpegvideo_enc: check that max_b_frames is not negative

Fixes crash found by saste
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>