avcodec/h264_slice: Fix integer overflow in implicit weight computation